avoid unnecessary reinterpret_casts