Sketch refactoring