Modified structure of CMake, pulled out private procedures