relay: move connection stuff to root