optimize the toc