Split serialization and deserialization
Simplify WRITE_*