I thought about moving this method to the model, but I think is is not possible because the session is accessed.