Merge "Refactor generateModel"