clean up extendTemplate, reusable on templateFinder