refactor Connection into a private class, since it can only be created by a Client.
moved ConnectionPrivate methods into Connection