refactor connectDots