begin converting to ActiveRecord