first pass creating template