Cleanup switchns code