cleaned up index controller