MutationMid refactoring, memory optimization for indices