extracted eyeswitch specific stuff