Refactory date validation