Small refactoring createIndexDifference()