GenerateModels  method updated