Refactor to use ActiveModel::Callbacks.