reworked the Controller class