made the controller a class