date time refactoring