chart refactoring
Refactored