Chenged to mongo and made code more db independent.