Chart - code reorganizing