The initial mixed mesh is subjected to several cycles of smoothing and cleanup. While the smoothing improves the shape and consequently the quality of individual elements, the cleanup removes the triangular elements from the mesh whenever possible and optimizes the mesh connectivity, resulting again in the improvement of the mesh quality. In each cycle, the smoothing is followed by the cleanup. However in the last cycle, only smoothing is performed followed by the convexity check. Typically, only a few cycles (around 6) are sufficient to obtain a reasonably optimized mesh.