Inc. (AMZN.O) and New York City could have worked better together to prevent the Seattle-based technology giant from scrapping its plan to build a second headquarters in the city, according to the chief executive of Sidewalk Labs.

“I think that both sides probably could have listened a bit better to each other, and ultimately could have come to what hopefully would have been an amicable solution that didn’t result the way it did,” Dan Doctoroff told BNN Bloomberg’s Jon Erlichman and Amber Kanwar on Friday.

Doctoroff’s comments come a day after Amazon announced it’s shelving its plan to open another headquarters in New York, bowing to fierce opposition from some residents and politicians.

For Alphabet Inc.-backed (GOOGL.O) Sidewalk Labs – which has faced its own criticism over how data and privacy will be handled in its plan to build a high-tech community in Toronto – opposing comments are actually helping to improve its  development plans, Doctoroff said. 

“That interaction – often contentious interaction – with the public and government officials actually makes plans better if you’re prepared to listen,” he said.

“We’ve been listening a lot. Some of it has been tough to listen to sometimes, but we’ve never cut and ran.”