Indexing refactor