refactored the patientController a bit