refactoring of drawing figures