update common.js to ES6