Clean up the template_name method