Changed to use callbacks instead of Future for connection, plus some
tweaks