Mongodb Refactor