improved environment const correctness