generate template file