Index refactor