gfx refactoring