Improved the pollution of the global scope in JS