refactoring the views