refactored using general update pattern & chart-update closure