make switch to controller connection into class
removed some old code