small changes to make fewer spline calls