Refactored to use a Deserializer class properly