Replace the explicit iteration with dict.update