some refactoring of main page