Refactor date logic into a Date class