Separated code to send data to server.
Separated code to send data to server.