switch c++ compiler from clang++ to g++
refactoring