Tidying up the controller