refactoring controller/model/view