consume magic byte in bitstream, too.
code cleanup