[cleanup] Get rid of const_cast