Reusable visualization code