Refactor rowRangeFrom into util.