refactor CMakeScript