refactor mongodb storage