Abstract module now handles different graph types.