references, fix port
factor packet-y stuff