Some refactorings to the chart.