Refactor Date method to avoid redundant code