Simplify range handling.
Some code and comments clean-up.