Improved Connect logic