additional refactoring of daterange method