Ashwin/Melanie | #3076 | Moving entity_types logic to template.