Refactorize connectors to use them in client and server
prepare refactor
Middle of refactoring