Restructure history.el.