Refactor date helpers