refactor for mongoid and moped