Design and optimization of Microwave Kinetic Inductance Detectors