reformatting packet creation to be more readable