refactoring first page