Custom packing and unpacking.