avoid unneeded const_cast