another clean up due to porting code to C++ version