Tidy up boolean env logic