break out common script env functions