Refactor and add Popular functionality.