updates code to current es6