Some refactoring. Maybe don't work correct isCirclesCollide and isRectanglesCollide.