Reorganized method lookup completely, switching to templated C++.