Refactoring graphics