The following methods could do with some refactoring: EditorLogic::BegingPainting() EditorLogic::Painting(), EditorLogic::EndPainting() they share duplicate code. Probably others too.