Moved visualization from event handlers