refactoring the special date handling