More work on the packet handler