refactored the index page