separate linear impl from public API
extract common functionality out to a horribly named namespace
constant piecewise interpolation function generator