optimize index controller