Generalized the graph loading and representation conversion routines