Refactor create client and http communication process