cleanup template variables