cleaning up the controller