connections logic