client: refactor send/readResponse() methods