Refactor, fix undo of list autoformat