refactor attach curlCh to client