Improve TOC to support file hierarchies