Added cobra class for connection management