initial work to refactor the indexer