The present invention relates to a phacoemulsification handpiece, comprising a needle and a microelectromechanical system (MEMS) device, wherein the needle is coupled with the MEMS device. The phacoemulsification handpiece may further comprise a horn, wherein the horn is coupled with the needle and the MEMS device. The MEMS device is capable of generating movement of the needle in at least one direction, wherein at least one direction is selected from the group consisting of transversal, torsional, and longitudinal. The present invention also relates to a method of generating movement, comprising providing a phacoemulsification handpiece, wherein the handpiece comprises a needle and one or more MEMS devices; applying a voltage or current to the one or more MEMS devices, wherein the MEMS devices are coupled with the needle; and moving the needle in at least one direction. The present invention also relates to a vitrectomy cutter comprising one or more MEMS devices.