Looking at how this is defined, I think this should be moved into a service.