refactored chart