Refactored Appointment JS and view.