You're right. It makes more sense to put this in a service. I will refactor it and commit the changes.