Remove the `for` loop inside `from_dict`