I am new to MVC programming.Currently I have a `User` model with one attribute `timespent`. I am using d3.js to plot time spent per user in one of my views. The current way I am implementing this is by incorporating all the logic of searching the database and getting the data in the correct format in the `UserController`. 

From what I have read on the sails docs, they recommend "thin" controllers whenever possible. Where else can I incorporate all this search/formatting code in a more reusable manner?