Partial conversion from C++