refactoring index page to use main template