Break off the serialization/deserialization into their own helper methods.