ActiveRecord::insert() and ActiveRecord::update() refactoring