Issue #2011492 by ianthomas_uk, Nick_vh, Mark_, mkalkbrenner: Remove duplicated indexing code