Refactored date handling to separate file.