organized the chart generation structure