tree based deserialization
serialization can also be changed to use the tree internally