big refactoring Connector class