better legacy support for ranges