refactoring views and models