clean up code in controllers/views