Refactored the ActiveRecord persistence classes to be more flexible.