extract packet creation to own module