refactor index / indexer