make sure polyfill function use native implementation if available
restructure index.js