Improved MongoDB interaction