Cleaned up receiving data from client.