removed the email templates from the main query and created a separate file with some comments