Can you change the name of this method from `factory` to `from_dict`? I think that `from_dict` is a lot clearer, but I'm also happy to discuss it if you disagree.