refactored repository structure, added qcg handling and checking for another working instance