mongoserver refactor