Make switch a class.