use static_cast instead of reinterpret_cast