Minor refactoring on the visualizer.