renamed env_type to