More work on simplifying and C++0x'ing the code