cleanup of main in the switch area