Extracted drawing to a render function