refactored the gzip decompression