Starting to refactor to merge Unsafe-based compressor in mainline