clearswitch front end code