refactored charts as well