Refactoring in DateUtil