refactored index_page()