Refactor index page