AMF - refactored to support more extensible serialization