Clean up and add coherence to the serialization process