build a template