change template compilation to follow templatizer more closely