Curious if there is a better way (prototype scripting)

I’m just curious if there is a better way to achieve the below in postman.

These are in the pre-request script at the collection level.


This script below is attached to the following request…
https://{{idp}}/as/authorization.oauth2?response_type=code&client_id={{client_id}}&redirect_uri={{redirect_uri}}


Internal refers to intranet/internet.