move some included headers in optimizer from c to c++