Added creating model by passing in type as well instead of just generic version.