clean up graph visualization code