clean up mongoid code