improved mongo functionality