Adding ResetIndex operation.
Refactoring index operations.