mongo util refactor