remove some unnecessary reinterpret_casts