refactoring pgf nodes