Refactored date utils