Refactoring in CMakeList.txt