Support for Mongoid, refactoring