Completed refactoring main page