small cleanup on the packet handler