refactored to use patientFactory pattern