Switched to c++ from c
Bunch of cleanup