Instances are valid providers too, so this should be serialized in a smarter way (I guess get_class on the providers if they are objects will do).