separated the template generator