refactor: port to ES6