Adding Controller class and a bit of refactoring inside the model