Avoid unnecessary calls to template_namespace