Refactor old CMake code
Refactor old CMake code