Updated switchControl to a class