[FOLD] Refactor connect attempts