More refactoring on creating index pages