Index page now rendering properly.
Some code re-organization.