charts refactor