improved env const correctness