This cast is pretty gross. Why don't we use our own (const-safe) struct type instead?