cartesian path code clean up, small improvements