full class switcher logic and templating