More refactoring. Some issue with adding rects to bezier curve