Packet parser refactoring