Small refactoring on charts