Refactoring of removeChart