Refactor range and add toString