Refactoring createIndexDifference()

Refactoring createIndexDifference()