wip: mongo refactoring