refactoring the home view