move template to template file