refactor index page