LPS-48189 move duplicated logic to the base indexer