Better env logic