Factor-out the code to make equally spaced partition points