Refactors 'Most Popular' page's PHP.