refactoring index pages