switch to using Object.keys and a plain for loop