factor out the connect pipe line above the CC