try making trending just a function.

And augment its template a bit.