refactor for contour tracing