Main page refactoring