improve efficiency of graph types