Cleaned up index controller