Can be refactored as `result["metadata"] = metadata || {}`.