Better diff de/serialization