Minor refactoring of the trending.