Factored out env