move connect to a proper place