Reorganize the history log