Merge "Extract Sidecar adapter functions." into main