does it need to be a new PR or can it be the same PR just a separate commit?
I'd move the get_config_vars() to a local var and use that -> much shorter lines everywhere