chart refactor part 1