Rewrote to handle Mongoid driver