replace several os.environ lookups with config