Combine serialization and deserialization headers, and use inline writer functions