CMake OPTION and some code cleanups