refactoring charting sys