finish the graph build in the class Factory