Refactoring. Full update with ActiveRecord.