Split the graph functionality into interfaces