We could avoid the duplication of code if we create a function like this in the global namespace for instance, WDYT?