Graphics refactoring