add to_tmpl method