refactoring…
Changed packet generation for handshake