remove use of Q in packing and unpacking