moved repeated code into a new file RectangleConnect