refactored getSetIndexes method