Refactoring the connector task