Changed switchOn and switchOff to unified switchState