finished with template generator