Make library more C++ friendly