factoring out c++ into seperate files.