use gzip; refactor decoding phase