Extract out to proxy.go