small refactoring - Caution: change the path of pgtest in CMakelists