graphics refactoring