date range search refactored