If I have a function that I intend to call from different controllers, but I have no need for the function to have a view, where should this function be defined? eg. a function that simply calculates the outcome of a math formula, and several controllers will call this function to display the result.
Should it be defined within a controller, or elsewhere?