small improvements and cleanup in connections
high level connection