- extracted createModelInstance as independent helper function