Small refactor of appoitnments.js