Cleaned up index page code