refactor mongo updates