Move TOC generation fully into an independent step