Move visualization logic out of media