Refactor doctors controller