es6 ugly but effective hack