Some refactoring of Graphbuilder