Allow the use of closures for environment detection.