refactored listTemplates