Refactored testswitch.el