refactor packet load/dump out from wire protocol