index refactoring