Refactor chart base