Use Object.keys to iterate properties instead of for+hasOwnProperty