refactor main page