small refactor to canonicalize_indexer