cleanup index controller code