TemplateForensics: reorganized some code. No functional change intended
Synced from master
Synced from master