refactoring index