remove duplicate disconnect method, use and IIFE for connecting