some changes to mongoid construction