Implement CMake, simplify classes