Refactor logic of creating ShareCircleServer and ShareCircleClient.