finished getting rid of multiple getenv calls