Refactor mongodb

Refactor code style