mongo callback refactor