Utility for working with ranges of values