integrate upstream
moved model constructor always behind factory