Added action pattern for undo/redo