code refactoring, more charts