Command pattern with undo button