More graphics refactoring