optimized redrawing