Little refactor of visualization code
Little refactoring of visualization code