nit: apply const qualifier to some functions
another round of const qualifiers...