refactoring of faking mongodb