ensures the templates are sorted by name