avoid unsafe const_cast