I think we could clean up the complexity by being more explicit with crypt_keeper. Rather than traverse the hierarchy looking for a certain class, just add something like this in model.rb

```ruby

def crypt_keeper(*args)
  class_attribute :crypt_keeper_options
  class_attribute :crypt_keeper_fields
  class_attribute :crypt_keeper_encryptor

  self.crypt_keeper_options   = args.extract_options!
  self.crypt_keeper_encryptor = crypt_keeper_options.delete(:encryptor)
  self.crypt_keeper_fields    = args

  set_persistence_layer!  
  ensure_valid_encryptor!
  define_crypt_keeper_callbacks
end

def set_persistence_layer!
  persistence = self.crypt_keeper_options.fetch(:persistence, :active_record)
  include "Persistence::#{persistence.camelize}".constantize
end

```

You should rename the ActiveRecordPersistence/Mongoid to ActiveRecord/Mongoid. It shouldn't cause a problem.