refactor range-from-interval creation into a separate method