restructure chartutils flow