I obviously missed this opportunity when I reviewed this
Merge pull request #989 from aodn/small_env_vars_tidy-up

Simplify some logic