Use classes for packets instead of the switch case.