reorganize content to generate TOC