Recording non-public environments
Tweak env check to be clearer.

Using underscore functions for a more obvious check if
environment is predefined.