Some connection stuff. WIP.