Moved from C to C++

Just externally, the utils functions still have to be adjusted