Refactoring of Undo/Redo

Ongoing.
Refactoring of Undo/Redo

Works