use more portable way for structure packing