Further refactoring of different types of graphs