Not sure it's the best idea to bleed this as another plugin, probably best to just have as a helper function.