Rewrite in ES6