proxy_client: refactor, massive things