Use C++ type system better.