Refactor the drawing method.