better test/env handling