Simplify history-watcher and undo-handler