builds templates in listTemplateHeaders