Splitting out range refine code into its own module.