graphicsProvider: simplify code