Updated generate model