Reorg of pkt handling and implementation of writing some payloads