organized visualization code