refactoring into cmake project and google test unit testing