Heavy refactoring of index page generation code to make things speedier & less complex