refactored Scripts. Added datepicker