refactoring homepage