toc fixes and code cleaning...