Some refactoring of TOC