Refactor and Add Popular Function