All that is above is the preparation of data to be used by a view, it belongs to a (missing) model file and not to the view.