refactoring graphic