Refactored rank_all_hospitals.R and utils.R to be more modular