Move shift_indexer into the shift function