clean the key index before diffing