Done.

> In another PR, we should put that function in a file accessible throughout the code, will be extremely useful.

I agree. But we have a backbone with a similar behavior.