improved const correctness