Fix gateways to use the new mechanism