This PR polishes the changes made in gh-40023 a bit.

Comment From: mhalbritter

Hey, thanks for the PR, i've added a comment.

Comment From: mhalbritter

Thanks!