better :)

```ruby
    def self.serialize(arguments)
      arguments.collect do |argument|
        case argument
        when ActiveModel::GlobalIdentification
          argument.global_id
        when *TYPE_WHITELIST
          argument
        when Hash
          Hash[ argument.map{ |key, value| [ serialize_key(key), serialize(value) ] } ]
        when Array
          serialize(argument)
        else
          raise "Unsupported argument type: #{argument.class.name}"
        end
      end
    end
```