move connect functionality from backend to runtime