split setup-env into setup-env, setup-single, setup-lib