refactor the index page