Controlling serialization and deserialization