first pass cleanup of drawing function done