refactor adding appointment, working on editing