changes for mongo and polyinstanciation