optimize toc and title numbers generation, fasten fop script