Refactored packet class and packet tests