rewrote packetbuilder to use polymorphism