smarter recursive setting