On the code organization level, it'd be nice to extract this somewhere non-extension specific as there will be two places using that from now onwards