Some drawing refactoring