Improve const correctness
Made functions const as noted in D461 to increase the overall const correctness for maintainability.