Refactoring patient controller.