Interesting. Did you make this a factory because it's the "AngularJS way" of dealing with such code and making dependencies clear? I mean, technically it could also just be a normal (namespaced) standalone function, given that the factory isn't parametrized in any way and the returned function doesn't use any Angular stuff. Just curious about the reasoning here, not saying it shouldn't be done this way.