[0.2.1] refactor onpacket listener

Signed-off-by: Eli Skeggs <eskeggs@globesherpa.com>