moving the function creation on the example and removing global namepace