several functions have been turned to const