Cleaned up the chart controller.