Extract functions for setting up env vars.