refactored from mongojs to mongodb driver