Code motion for visualization