move contour drawing to service