Refactored datepicker setup