simplified code with Object.assign ponyfill