Externalize serialization out of compressor