Simplify toc code