minor fix
bit refactor to reduce the access to Mongo