changed method name to prepare_graph_factory