Refactor popularity function