Refactoring step. Main page works.