Refactoring the edit dictionary functionality a bit