Rails initializer to be more clean I need a little bit of refactor my initialize method because I think it will make initializer more flexible and readable.

class LogAdminData
  DEFAULT_EXCLUDED_PARAMS = %w[
    encrypted_password
    reset_password_token
    reset_password_sent_at
  ].freeze

  def initialize(admin_obj:, action_type:, old_data:, new_data:, excluded_params: %w[])
    excluded_params += DEFAULT_EXCLUDED_PARAMS
    @old_data = old_data.reject { |k, _v| excluded_params.include? k }
    @new_data = new_data.reject { |k, _v| excluded_params.include? k }
    @action_type = action_type
    @admin_email = admin_obj.email
    @admin_role = admin_obj.role
  end

  def call
    AdminPanelLog.create(
      admin_email: admin_email,
      admin_role: admin_role,
      action_type: action_type,
      new_data: new_data,
      old_data: old_data,
    )
  end


Maybe something like 

  def cleanup_data(data)
    excluded_params += DEFAULT_EXCLUDED_PARAMS
    data.reject { |k, _v| excluded_params.include? k }
  end


But how to call it in initializer using old_data and new_data?
If this is a Rails project (or you use ActiveSupport) you can replace

@old_data = old_data.reject { |k, _v| excluded_params.include? k }
with
@old_data = old_data.except(excluded_params)