ran with mdotson's idea for generic deserialization