simplify decode_chuncked function