Optimize the way autoconnection works