packet class refactoring