reducing repainting