Reducing scope and adding const correctness.