date refactoring