refactoring.
Ranges support added.