A few c++ helper classes