refactor charts