moved GraphFactory to util/