implement pack/unpack feature