refactor date range