moved initviz code to controller