Implement deserialization using from_dict instead of __init__