separate controllers and views, refactoring