Small refactoring of contour