Code quality enhancements to templates.