diff --git a/balancer/grpclb/grpc_lb_v1/load_balancer.pb.go b/balancer/grpclb/grpc_lb_v1/load_balancer.pb.go
index b59191a..7381dfc 100644
--- a/balancer/grpclb/grpc_lb_v1/load_balancer.pb.go
+++ b/balancer/grpclb/grpc_lb_v1/load_balancer.pb.go
@@ -4,14 +4,10 @@
 package grpc_lb_v1
 
 import (
-	context "context"
 	fmt "fmt"
 	proto "github.com/golang/protobuf/proto"
 	duration "github.com/golang/protobuf/ptypes/duration"
 	timestamp "github.com/golang/protobuf/ptypes/timestamp"
-	grpc "google.golang.org/grpc"
-	codes "google.golang.org/grpc/codes"
-	status "google.golang.org/grpc/status"
 	math "math"
 )
 
@@ -642,117 +638,3 @@
 	0x6d, 0xe1, 0xbe, 0xfb, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x47, 0x55, 0xac, 0xab, 0x06, 0x00,
 	0x00,
 }
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConnInterface
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion6
-
-// LoadBalancerClient is the client API for LoadBalancer service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type LoadBalancerClient interface {
-	// Bidirectional rpc to get a list of servers.
-	BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error)
-}
-
-type loadBalancerClient struct {
-	cc grpc.ClientConnInterface
-}
-
-func NewLoadBalancerClient(cc grpc.ClientConnInterface) LoadBalancerClient {
-	return &loadBalancerClient{cc}
-}
-
-func (c *loadBalancerClient) BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error) {
-	stream, err := c.cc.NewStream(ctx, &_LoadBalancer_serviceDesc.Streams[0], "/grpc.lb.v1.LoadBalancer/BalanceLoad", opts...)
-	if err != nil {
-		return nil, err
-	}
-	x := &loadBalancerBalanceLoadClient{stream}
-	return x, nil
-}
-
-type LoadBalancer_BalanceLoadClient interface {
-	Send(*LoadBalanceRequest) error
-	Recv() (*LoadBalanceResponse, error)
-	grpc.ClientStream
-}
-
-type loadBalancerBalanceLoadClient struct {
-	grpc.ClientStream
-}
-
-func (x *loadBalancerBalanceLoadClient) Send(m *LoadBalanceRequest) error {
-	return x.ClientStream.SendMsg(m)
-}
-
-func (x *loadBalancerBalanceLoadClient) Recv() (*LoadBalanceResponse, error) {
-	m := new(LoadBalanceResponse)
-	if err := x.ClientStream.RecvMsg(m); err != nil {
-		return nil, err
-	}
-	return m, nil
-}
-
-// LoadBalancerServer is the server API for LoadBalancer service.
-type LoadBalancerServer interface {
-	// Bidirectional rpc to get a list of servers.
-	BalanceLoad(LoadBalancer_BalanceLoadServer) error
-}
-
-// UnimplementedLoadBalancerServer can be embedded to have forward compatible implementations.
-type UnimplementedLoadBalancerServer struct {
-}
-
-func (*UnimplementedLoadBalancerServer) BalanceLoad(srv LoadBalancer_BalanceLoadServer) error {
-	return status.Errorf(codes.Unimplemented, "method BalanceLoad not implemented")
-}
-
-func RegisterLoadBalancerServer(s *grpc.Server, srv LoadBalancerServer) {
-	s.RegisterService(&_LoadBalancer_serviceDesc, srv)
-}
-
-func _LoadBalancer_BalanceLoad_Handler(srv interface{}, stream grpc.ServerStream) error {
-	return srv.(LoadBalancerServer).BalanceLoad(&loadBalancerBalanceLoadServer{stream})
-}
-
-type LoadBalancer_BalanceLoadServer interface {
-	Send(*LoadBalanceResponse) error
-	Recv() (*LoadBalanceRequest, error)
-	grpc.ServerStream
-}
-
-type loadBalancerBalanceLoadServer struct {
-	grpc.ServerStream
-}
-
-func (x *loadBalancerBalanceLoadServer) Send(m *LoadBalanceResponse) error {
-	return x.ServerStream.SendMsg(m)
-}
-
-func (x *loadBalancerBalanceLoadServer) Recv() (*LoadBalanceRequest, error) {
-	m := new(LoadBalanceRequest)
-	if err := x.ServerStream.RecvMsg(m); err != nil {
-		return nil, err
-	}
-	return m, nil
-}
-
-var _LoadBalancer_serviceDesc = grpc.ServiceDesc{
-	ServiceName: "grpc.lb.v1.LoadBalancer",
-	HandlerType: (*LoadBalancerServer)(nil),
-	Methods:     []grpc.MethodDesc{},
-	Streams: []grpc.StreamDesc{
-		{
-			StreamName:    "BalanceLoad",
-			Handler:       _LoadBalancer_BalanceLoad_Handler,
-			ServerStreams: true,
-			ClientStreams: true,
-		},
-	},
-	Metadata: "grpc/lb/v1/load_balancer.proto",
-}
diff --git a/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go b/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go
index e59bf30..62bd5be 100644
--- a/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go
+++ b/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go
@@ -3,6 +3,7 @@
 package grpc_lb_v1
 
 import (
+	context "context"
 	grpc "google.golang.org/grpc"
 	codes "google.golang.org/grpc/codes"
 	status "google.golang.org/grpc/status"
@@ -12,6 +13,59 @@
 // is compatible with the grpc package it is being compiled against.
 const _ = grpc.SupportPackageIsVersion7
 
+// LoadBalancerClient is the client API for LoadBalancer service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type LoadBalancerClient interface {
+	// Bidirectional rpc to get a list of servers.
+	BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error)
+}
+
+type loadBalancerClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewLoadBalancerClient(cc grpc.ClientConnInterface) LoadBalancerClient {
+	return &loadBalancerClient{cc}
+}
+
+var loadBalancerBalanceLoadStreamDesc = &grpc.StreamDesc{
+	StreamName:    "BalanceLoad",
+	ServerStreams: true,
+	ClientStreams: true,
+}
+
+func (c *loadBalancerClient) BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error) {
+	stream, err := c.cc.NewStream(ctx, loadBalancerBalanceLoadStreamDesc, "/grpc.lb.v1.LoadBalancer/BalanceLoad", opts...)
+	if err != nil {
+		return nil, err
+	}
+	x := &loadBalancerBalanceLoadClient{stream}
+	return x, nil
+}
+
+type LoadBalancer_BalanceLoadClient interface {
+	Send(*LoadBalanceRequest) error
+	Recv() (*LoadBalanceResponse, error)
+	grpc.ClientStream
+}
+
+type loadBalancerBalanceLoadClient struct {
+	grpc.ClientStream
+}
+
+func (x *loadBalancerBalanceLoadClient) Send(m *LoadBalanceRequest) error {
+	return x.ClientStream.SendMsg(m)
+}
+
+func (x *loadBalancerBalanceLoadClient) Recv() (*LoadBalanceResponse, error) {
+	m := new(LoadBalanceResponse)
+	if err := x.ClientStream.RecvMsg(m); err != nil {
+		return nil, err
+	}
+	return m, nil
+}
+
 // LoadBalancerService is the service API for LoadBalancer service.
 // Fields should be assigned to their respective handler implementations only before
 // RegisterLoadBalancerService is called.  Any unassigned fields will result in the
@@ -25,6 +79,28 @@
 	return s.BalanceLoad(&loadBalancerBalanceLoadServer{stream})
 }
 
+type LoadBalancer_BalanceLoadServer interface {
+	Send(*LoadBalanceResponse) error
+	Recv() (*LoadBalanceRequest, error)
+	grpc.ServerStream
+}
+
+type loadBalancerBalanceLoadServer struct {
+	grpc.ServerStream
+}
+
+func (x *loadBalancerBalanceLoadServer) Send(m *LoadBalanceResponse) error {
+	return x.ServerStream.SendMsg(m)
+}
+
+func (x *loadBalancerBalanceLoadServer) Recv() (*LoadBalanceRequest, error) {
+	m := new(LoadBalanceRequest)
+	if err := x.ServerStream.RecvMsg(m); err != nil {
+		return nil, err
+	}
+	return m, nil
+}
+
 // RegisterLoadBalancerService registers a service implementation with a gRPC server.
 func RegisterLoadBalancerService(s grpc.ServiceRegistrar, srv *LoadBalancerService) {
 	srvCopy := *srv
@@ -50,27 +126,28 @@
 	s.RegisterService(&sd, nil)
 }
 
-// NewLoadBalancerService creates a new LoadBalancerService containing the
-// implemented methods of the LoadBalancer service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewLoadBalancerService(s interface{}) *LoadBalancerService {
-	ns := &LoadBalancerService{}
-	if h, ok := s.(interface {
-		BalanceLoad(LoadBalancer_BalanceLoadServer) error
-	}); ok {
-		ns.BalanceLoad = h.BalanceLoad
-	}
-	return ns
-}
-
-// UnstableLoadBalancerService is the service API for LoadBalancer service.
+// LoadBalancerServer is the service API for LoadBalancer service.
 // New methods may be added to this interface if they are added to the service
 // definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableLoadBalancerService interface {
+// use of this type is not recommended unless you own the service definition.
+type LoadBalancerServer interface {
 	// Bidirectional rpc to get a list of servers.
 	BalanceLoad(LoadBalancer_BalanceLoadServer) error
 }
+
+// UnimplementedLoadBalancerServer can be embedded to have forward compatible implementations of
+// LoadBalancerServer
+type UnimplementedLoadBalancerServer struct {
+}
+
+func (*UnimplementedLoadBalancerServer) BalanceLoad(LoadBalancer_BalanceLoadServer) error {
+	return status.Errorf(codes.Unimplemented, "method BalanceLoad not implemented")
+}
+
+// RegisterLoadBalancerServer registers a service implementation with a gRPC server.
+func RegisterLoadBalancerServer(s grpc.ServiceRegistrar, srv LoadBalancerServer) {
+	str := &LoadBalancerService{
+		BalanceLoad: srv.BalanceLoad,
+	}
+	RegisterLoadBalancerService(s, str)
+}
diff --git a/balancer/rls/internal/proto/grpc_lookup_v1/rls.pb.go b/balancer/rls/internal/proto/grpc_lookup_v1/rls.pb.go
index a3a3f81..7ec1427 100644
--- a/balancer/rls/internal/proto/grpc_lookup_v1/rls.pb.go
+++ b/balancer/rls/internal/proto/grpc_lookup_v1/rls.pb.go
@@ -4,12 +4,8 @@
 package grpc_lookup_v1
 
 import (
-	context "context"
 	fmt "fmt"
 	proto "github.com/golang/protobuf/proto"
-	grpc "google.golang.org/grpc"
-	codes "google.golang.org/grpc/codes"
-	status "google.golang.org/grpc/status"
 	math "math"
 )
 
@@ -180,85 +176,3 @@
 	0x29, 0xa7, 0xcf, 0x5e, 0xb3, 0x1d, 0x27, 0xef, 0x01, 0x00, 0x00, 0xff, 0xff, 0xca, 0x8d, 0x5c,
 	0xc7, 0x39, 0x02, 0x00, 0x00,
 }
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConnInterface
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion6
-
-// RouteLookupServiceClient is the client API for RouteLookupService service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type RouteLookupServiceClient interface {
-	// Lookup returns a target for a single key.
-	RouteLookup(ctx context.Context, in *RouteLookupRequest, opts ...grpc.CallOption) (*RouteLookupResponse, error)
-}
-
-type routeLookupServiceClient struct {
-	cc grpc.ClientConnInterface
-}
-
-func NewRouteLookupServiceClient(cc grpc.ClientConnInterface) RouteLookupServiceClient {
-	return &routeLookupServiceClient{cc}
-}
-
-func (c *routeLookupServiceClient) RouteLookup(ctx context.Context, in *RouteLookupRequest, opts ...grpc.CallOption) (*RouteLookupResponse, error) {
-	out := new(RouteLookupResponse)
-	err := c.cc.Invoke(ctx, "/grpc.lookup.v1.RouteLookupService/RouteLookup", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-// RouteLookupServiceServer is the server API for RouteLookupService service.
-type RouteLookupServiceServer interface {
-	// Lookup returns a target for a single key.
-	RouteLookup(context.Context, *RouteLookupRequest) (*RouteLookupResponse, error)
-}
-
-// UnimplementedRouteLookupServiceServer can be embedded to have forward compatible implementations.
-type UnimplementedRouteLookupServiceServer struct {
-}
-
-func (*UnimplementedRouteLookupServiceServer) RouteLookup(ctx context.Context, req *RouteLookupRequest) (*RouteLookupResponse, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method RouteLookup not implemented")
-}
-
-func RegisterRouteLookupServiceServer(s *grpc.Server, srv RouteLookupServiceServer) {
-	s.RegisterService(&_RouteLookupService_serviceDesc, srv)
-}
-
-func _RouteLookupService_RouteLookup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(RouteLookupRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(RouteLookupServiceServer).RouteLookup(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/grpc.lookup.v1.RouteLookupService/RouteLookup",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(RouteLookupServiceServer).RouteLookup(ctx, req.(*RouteLookupRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-var _RouteLookupService_serviceDesc = grpc.ServiceDesc{
-	ServiceName: "grpc.lookup.v1.RouteLookupService",
-	HandlerType: (*RouteLookupServiceServer)(nil),
-	Methods: []grpc.MethodDesc{
-		{
-			MethodName: "RouteLookup",
-			Handler:    _RouteLookupService_RouteLookup_Handler,
-		},
-	},
-	Streams:  []grpc.StreamDesc{},
-	Metadata: "grpc/lookup/v1/rls.proto",
-}
diff --git a/balancer/rls/internal/proto/grpc_lookup_v1/rls_grpc.pb.go b/balancer/rls/internal/proto/grpc_lookup_v1/rls_grpc.pb.go
index 4a9f270..6952ce6 100644
--- a/balancer/rls/internal/proto/grpc_lookup_v1/rls_grpc.pb.go
+++ b/balancer/rls/internal/proto/grpc_lookup_v1/rls_grpc.pb.go
@@ -13,6 +13,35 @@
 // is compatible with the grpc package it is being compiled against.
 const _ = grpc.SupportPackageIsVersion7
 
+// RouteLookupServiceClient is the client API for RouteLookupService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type RouteLookupServiceClient interface {
+	// Lookup returns a target for a single key.
+	RouteLookup(ctx context.Context, in *RouteLookupRequest, opts ...grpc.CallOption) (*RouteLookupResponse, error)
+}
+
+type routeLookupServiceClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewRouteLookupServiceClient(cc grpc.ClientConnInterface) RouteLookupServiceClient {
+	return &routeLookupServiceClient{cc}
+}
+
+var routeLookupServiceRouteLookupStreamDesc = &grpc.StreamDesc{
+	StreamName: "RouteLookup",
+}
+
+func (c *routeLookupServiceClient) RouteLookup(ctx context.Context, in *RouteLookupRequest, opts ...grpc.CallOption) (*RouteLookupResponse, error) {
+	out := new(RouteLookupResponse)
+	err := c.cc.Invoke(ctx, "/grpc.lookup.v1.RouteLookupService/RouteLookup", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // RouteLookupServiceService is the service API for RouteLookupService service.
 // Fields should be assigned to their respective handler implementations only before
 // RegisterRouteLookupServiceService is called.  Any unassigned fields will result in the
@@ -63,27 +92,28 @@
 	s.RegisterService(&sd, nil)
 }
 
-// NewRouteLookupServiceService creates a new RouteLookupServiceService containing the
-// implemented methods of the RouteLookupService service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewRouteLookupServiceService(s interface{}) *RouteLookupServiceService {
-	ns := &RouteLookupServiceService{}
-	if h, ok := s.(interface {
-		RouteLookup(context.Context, *RouteLookupRequest) (*RouteLookupResponse, error)
-	}); ok {
-		ns.RouteLookup = h.RouteLookup
-	}
-	return ns
-}
-
-// UnstableRouteLookupServiceService is the service API for RouteLookupService service.
+// RouteLookupServiceServer is the service API for RouteLookupService service.
 // New methods may be added to this interface if they are added to the service
 // definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableRouteLookupServiceService interface {
+// use of this type is not recommended unless you own the service definition.
+type RouteLookupServiceServer interface {
 	// Lookup returns a target for a single key.
 	RouteLookup(context.Context, *RouteLookupRequest) (*RouteLookupResponse, error)
 }
+
+// UnimplementedRouteLookupServiceServer can be embedded to have forward compatible implementations of
+// RouteLookupServiceServer
+type UnimplementedRouteLookupServiceServer struct {
+}
+
+func (*UnimplementedRouteLookupServiceServer) RouteLookup(context.Context, *RouteLookupRequest) (*RouteLookupResponse, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method RouteLookup not implemented")
+}
+
+// RegisterRouteLookupServiceServer registers a service implementation with a gRPC server.
+func RegisterRouteLookupServiceServer(s grpc.ServiceRegistrar, srv RouteLookupServiceServer) {
+	str := &RouteLookupServiceService{
+		RouteLookup: srv.RouteLookup,
+	}
+	RegisterRouteLookupServiceService(s, str)
+}
diff --git a/benchmark/benchmark.go b/benchmark/benchmark.go
index d2783a8..5794aeb 100644
--- a/benchmark/benchmark.go
+++ b/benchmark/benchmark.go
@@ -63,7 +63,13 @@
 
 type testServer struct{}
 
-var _ testpb.UnstableBenchmarkServiceService = (*testServer)(nil)
+func (s *testServer) Svc() *testpb.BenchmarkServiceService {
+	return &testpb.BenchmarkServiceService{
+		UnaryCall:                  s.UnaryCall,
+		StreamingCall:              s.StreamingCall,
+		UnconstrainedStreamingCall: s.UnconstrainedStreamingCall,
+	}
+}
 
 func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
 	return &testpb.SimpleResponse{
@@ -147,7 +153,13 @@
 	respSize int32
 }
 
-var _ testpb.UnstableBenchmarkServiceService = (*byteBufServer)(nil)
+func (s *byteBufServer) Svc() *testpb.BenchmarkServiceService {
+	return &testpb.BenchmarkServiceService{
+		UnaryCall:                  s.UnaryCall,
+		StreamingCall:              s.StreamingCall,
+		UnconstrainedStreamingCall: s.UnconstrainedStreamingCall,
+	}
+}
 
 // UnaryCall is an empty function and is not used for benchmark.
 // If bytebuf UnaryCall benchmark is needed later, the function body needs to be updated.
@@ -212,13 +224,13 @@
 	s := grpc.NewServer(opts...)
 	switch info.Type {
 	case "protobuf":
-		testpb.RegisterBenchmarkServiceService(s, testpb.NewBenchmarkServiceService(&testServer{}))
+		testpb.RegisterBenchmarkServiceService(s, (&testServer{}).Svc())
 	case "bytebuf":
 		respSize, ok := info.Metadata.(int32)
 		if !ok {
 			logger.Fatalf("failed to StartServer, invalid metadata: %v, for Type: %v", info.Metadata, info.Type)
 		}
-		testpb.RegisterBenchmarkServiceService(s, testpb.NewBenchmarkServiceService(&byteBufServer{respSize: respSize}))
+		testpb.RegisterBenchmarkServiceService(s, (&byteBufServer{respSize: respSize}).Svc())
 	default:
 		logger.Fatalf("failed to StartServer, unknown Type: %v", info.Type)
 	}
diff --git a/benchmark/grpc_testing/services_grpc.pb.go b/benchmark/grpc_testing/services_grpc.pb.go
index 37d637d..81e9ed6 100644
--- a/benchmark/grpc_testing/services_grpc.pb.go
+++ b/benchmark/grpc_testing/services_grpc.pb.go
@@ -253,48 +253,6 @@
 	s.RegisterService(&sd, nil)
 }
 
-// NewBenchmarkServiceService creates a new BenchmarkServiceService containing the
-// implemented methods of the BenchmarkService service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewBenchmarkServiceService(s interface{}) *BenchmarkServiceService {
-	ns := &BenchmarkServiceService{}
-	if h, ok := s.(interface {
-		UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error)
-	}); ok {
-		ns.UnaryCall = h.UnaryCall
-	}
-	if h, ok := s.(interface {
-		StreamingCall(BenchmarkService_StreamingCallServer) error
-	}); ok {
-		ns.StreamingCall = h.StreamingCall
-	}
-	if h, ok := s.(interface {
-		UnconstrainedStreamingCall(BenchmarkService_UnconstrainedStreamingCallServer) error
-	}); ok {
-		ns.UnconstrainedStreamingCall = h.UnconstrainedStreamingCall
-	}
-	return ns
-}
-
-// UnstableBenchmarkServiceService is the service API for BenchmarkService service.
-// New methods may be added to this interface if they are added to the service
-// definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableBenchmarkServiceService interface {
-	// One request followed by one response.
-	// The server returns the client payload as-is.
-	UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error)
-	// One request followed by one response.
-	// The server returns the client payload as-is.
-	StreamingCall(BenchmarkService_StreamingCallServer) error
-	// Unconstrainted streaming.
-	// Both server and client keep sending & receiving simultaneously.
-	UnconstrainedStreamingCall(BenchmarkService_UnconstrainedStreamingCallServer) error
-}
-
 // WorkerServiceClient is the client API for WorkerService service.
 //
 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
@@ -591,59 +549,3 @@
 
 	s.RegisterService(&sd, nil)
 }
-
-// NewWorkerServiceService creates a new WorkerServiceService containing the
-// implemented methods of the WorkerService service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewWorkerServiceService(s interface{}) *WorkerServiceService {
-	ns := &WorkerServiceService{}
-	if h, ok := s.(interface {
-		RunServer(WorkerService_RunServerServer) error
-	}); ok {
-		ns.RunServer = h.RunServer
-	}
-	if h, ok := s.(interface {
-		RunClient(WorkerService_RunClientServer) error
-	}); ok {
-		ns.RunClient = h.RunClient
-	}
-	if h, ok := s.(interface {
-		CoreCount(context.Context, *CoreRequest) (*CoreResponse, error)
-	}); ok {
-		ns.CoreCount = h.CoreCount
-	}
-	if h, ok := s.(interface {
-		QuitWorker(context.Context, *Void) (*Void, error)
-	}); ok {
-		ns.QuitWorker = h.QuitWorker
-	}
-	return ns
-}
-
-// UnstableWorkerServiceService is the service API for WorkerService service.
-// New methods may be added to this interface if they are added to the service
-// definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableWorkerServiceService interface {
-	// Start server with specified workload.
-	// First request sent specifies the ServerConfig followed by ServerStatus
-	// response. After that, a "Mark" can be sent anytime to request the latest
-	// stats. Closing the stream will initiate shutdown of the test server
-	// and once the shutdown has finished, the OK status is sent to terminate
-	// this RPC.
-	RunServer(WorkerService_RunServerServer) error
-	// Start client with specified workload.
-	// First request sent specifies the ClientConfig followed by ClientStatus
-	// response. After that, a "Mark" can be sent anytime to request the latest
-	// stats. Closing the stream will initiate shutdown of the test client
-	// and once the shutdown has finished, the OK status is sent to terminate
-	// this RPC.
-	RunClient(WorkerService_RunClientServer) error
-	// Just return the core count - unary call
-	CoreCount(context.Context, *CoreRequest) (*CoreResponse, error)
-	// Quit this worker
-	QuitWorker(context.Context, *Void) (*Void, error)
-}
diff --git a/benchmark/worker/main.go b/benchmark/worker/main.go
index 891cd01..71a1fb6 100644
--- a/benchmark/worker/main.go
+++ b/benchmark/worker/main.go
@@ -79,7 +79,14 @@
 	serverPort int
 }
 
-var _ testpb.UnstableWorkerServiceService = (*workerServer)(nil)
+func (s *workerServer) Svc() *testpb.WorkerServiceService {
+	return &testpb.WorkerServiceService{
+		RunServer:  s.RunServer,
+		RunClient:  s.RunClient,
+		CoreCount:  s.CoreCount,
+		QuitWorker: s.QuitWorker,
+	}
+}
 
 func (s *workerServer) RunServer(stream testpb.WorkerService_RunServerServer) error {
 	var bs *benchmarkServer
@@ -210,10 +217,10 @@
 
 	s := grpc.NewServer()
 	stop := make(chan bool)
-	testpb.RegisterWorkerServiceService(s, testpb.NewWorkerServiceService(&workerServer{
+	testpb.RegisterWorkerServiceService(s, (&workerServer{
 		stop:       stop,
 		serverPort: *serverPort,
-	}))
+	}).Svc())
 
 	go func() {
 		<-stop
diff --git a/channelz/grpc_channelz_v1/channelz.pb.go b/channelz/grpc_channelz_v1/channelz.pb.go
index 34bfa5a..9c364e1 100644
--- a/channelz/grpc_channelz_v1/channelz.pb.go
+++ b/channelz/grpc_channelz_v1/channelz.pb.go
@@ -4,16 +4,12 @@
 package grpc_channelz_v1
 
 import (
-	context "context"
 	fmt "fmt"
 	proto "github.com/golang/protobuf/proto"
 	any "github.com/golang/protobuf/ptypes/any"
 	duration "github.com/golang/protobuf/ptypes/duration"
 	timestamp "github.com/golang/protobuf/ptypes/timestamp"
 	wrappers "github.com/golang/protobuf/ptypes/wrappers"
-	grpc "google.golang.org/grpc"
-	codes "google.golang.org/grpc/codes"
-	status "google.golang.org/grpc/status"
 	math "math"
 )
 
@@ -2925,315 +2921,3 @@
 	0xd3, 0x77, 0xc6, 0x68, 0xe7, 0x3c, 0xcf, 0x4f, 0xf3, 0x5f, 0xfd, 0x37, 0x00, 0x00, 0xff, 0xff,
 	0x54, 0xae, 0x0b, 0x93, 0xdf, 0x1f, 0x00, 0x00,
 }
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConnInterface
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion6
-
-// ChannelzClient is the client API for Channelz service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type ChannelzClient interface {
-	// Gets all root channels (i.e. channels the application has directly
-	// created). This does not include subchannels nor non-top level channels.
-	GetTopChannels(ctx context.Context, in *GetTopChannelsRequest, opts ...grpc.CallOption) (*GetTopChannelsResponse, error)
-	// Gets all servers that exist in the process.
-	GetServers(ctx context.Context, in *GetServersRequest, opts ...grpc.CallOption) (*GetServersResponse, error)
-	// Returns a single Server, or else a NOT_FOUND code.
-	GetServer(ctx context.Context, in *GetServerRequest, opts ...grpc.CallOption) (*GetServerResponse, error)
-	// Gets all server sockets that exist in the process.
-	GetServerSockets(ctx context.Context, in *GetServerSocketsRequest, opts ...grpc.CallOption) (*GetServerSocketsResponse, error)
-	// Returns a single Channel, or else a NOT_FOUND code.
-	GetChannel(ctx context.Context, in *GetChannelRequest, opts ...grpc.CallOption) (*GetChannelResponse, error)
-	// Returns a single Subchannel, or else a NOT_FOUND code.
-	GetSubchannel(ctx context.Context, in *GetSubchannelRequest, opts ...grpc.CallOption) (*GetSubchannelResponse, error)
-	// Returns a single Socket or else a NOT_FOUND code.
-	GetSocket(ctx context.Context, in *GetSocketRequest, opts ...grpc.CallOption) (*GetSocketResponse, error)
-}
-
-type channelzClient struct {
-	cc grpc.ClientConnInterface
-}
-
-func NewChannelzClient(cc grpc.ClientConnInterface) ChannelzClient {
-	return &channelzClient{cc}
-}
-
-func (c *channelzClient) GetTopChannels(ctx context.Context, in *GetTopChannelsRequest, opts ...grpc.CallOption) (*GetTopChannelsResponse, error) {
-	out := new(GetTopChannelsResponse)
-	err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetTopChannels", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *channelzClient) GetServers(ctx context.Context, in *GetServersRequest, opts ...grpc.CallOption) (*GetServersResponse, error) {
-	out := new(GetServersResponse)
-	err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetServers", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *channelzClient) GetServer(ctx context.Context, in *GetServerRequest, opts ...grpc.CallOption) (*GetServerResponse, error) {
-	out := new(GetServerResponse)
-	err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetServer", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *channelzClient) GetServerSockets(ctx context.Context, in *GetServerSocketsRequest, opts ...grpc.CallOption) (*GetServerSocketsResponse, error) {
-	out := new(GetServerSocketsResponse)
-	err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetServerSockets", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *channelzClient) GetChannel(ctx context.Context, in *GetChannelRequest, opts ...grpc.CallOption) (*GetChannelResponse, error) {
-	out := new(GetChannelResponse)
-	err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetChannel", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *channelzClient) GetSubchannel(ctx context.Context, in *GetSubchannelRequest, opts ...grpc.CallOption) (*GetSubchannelResponse, error) {
-	out := new(GetSubchannelResponse)
-	err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetSubchannel", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *channelzClient) GetSocket(ctx context.Context, in *GetSocketRequest, opts ...grpc.CallOption) (*GetSocketResponse, error) {
-	out := new(GetSocketResponse)
-	err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetSocket", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-// ChannelzServer is the server API for Channelz service.
-type ChannelzServer interface {
-	// Gets all root channels (i.e. channels the application has directly
-	// created). This does not include subchannels nor non-top level channels.
-	GetTopChannels(context.Context, *GetTopChannelsRequest) (*GetTopChannelsResponse, error)
-	// Gets all servers that exist in the process.
-	GetServers(context.Context, *GetServersRequest) (*GetServersResponse, error)
-	// Returns a single Server, or else a NOT_FOUND code.
-	GetServer(context.Context, *GetServerRequest) (*GetServerResponse, error)
-	// Gets all server sockets that exist in the process.
-	GetServerSockets(context.Context, *GetServerSocketsRequest) (*GetServerSocketsResponse, error)
-	// Returns a single Channel, or else a NOT_FOUND code.
-	GetChannel(context.Context, *GetChannelRequest) (*GetChannelResponse, error)
-	// Returns a single Subchannel, or else a NOT_FOUND code.
-	GetSubchannel(context.Context, *GetSubchannelRequest) (*GetSubchannelResponse, error)
-	// Returns a single Socket or else a NOT_FOUND code.
-	GetSocket(context.Context, *GetSocketRequest) (*GetSocketResponse, error)
-}
-
-// UnimplementedChannelzServer can be embedded to have forward compatible implementations.
-type UnimplementedChannelzServer struct {
-}
-
-func (*UnimplementedChannelzServer) GetTopChannels(ctx context.Context, req *GetTopChannelsRequest) (*GetTopChannelsResponse, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method GetTopChannels not implemented")
-}
-func (*UnimplementedChannelzServer) GetServers(ctx context.Context, req *GetServersRequest) (*GetServersResponse, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method GetServers not implemented")
-}
-func (*UnimplementedChannelzServer) GetServer(ctx context.Context, req *GetServerRequest) (*GetServerResponse, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method GetServer not implemented")
-}
-func (*UnimplementedChannelzServer) GetServerSockets(ctx context.Context, req *GetServerSocketsRequest) (*GetServerSocketsResponse, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method GetServerSockets not implemented")
-}
-func (*UnimplementedChannelzServer) GetChannel(ctx context.Context, req *GetChannelRequest) (*GetChannelResponse, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method GetChannel not implemented")
-}
-func (*UnimplementedChannelzServer) GetSubchannel(ctx context.Context, req *GetSubchannelRequest) (*GetSubchannelResponse, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method GetSubchannel not implemented")
-}
-func (*UnimplementedChannelzServer) GetSocket(ctx context.Context, req *GetSocketRequest) (*GetSocketResponse, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method GetSocket not implemented")
-}
-
-func RegisterChannelzServer(s *grpc.Server, srv ChannelzServer) {
-	s.RegisterService(&_Channelz_serviceDesc, srv)
-}
-
-func _Channelz_GetTopChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(GetTopChannelsRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChannelzServer).GetTopChannels(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/grpc.channelz.v1.Channelz/GetTopChannels",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChannelzServer).GetTopChannels(ctx, req.(*GetTopChannelsRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Channelz_GetServers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(GetServersRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChannelzServer).GetServers(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/grpc.channelz.v1.Channelz/GetServers",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChannelzServer).GetServers(ctx, req.(*GetServersRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Channelz_GetServer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(GetServerRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChannelzServer).GetServer(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/grpc.channelz.v1.Channelz/GetServer",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChannelzServer).GetServer(ctx, req.(*GetServerRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Channelz_GetServerSockets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(GetServerSocketsRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChannelzServer).GetServerSockets(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/grpc.channelz.v1.Channelz/GetServerSockets",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChannelzServer).GetServerSockets(ctx, req.(*GetServerSocketsRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Channelz_GetChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(GetChannelRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChannelzServer).GetChannel(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/grpc.channelz.v1.Channelz/GetChannel",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChannelzServer).GetChannel(ctx, req.(*GetChannelRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Channelz_GetSubchannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(GetSubchannelRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChannelzServer).GetSubchannel(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/grpc.channelz.v1.Channelz/GetSubchannel",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChannelzServer).GetSubchannel(ctx, req.(*GetSubchannelRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Channelz_GetSocket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(GetSocketRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ChannelzServer).GetSocket(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/grpc.channelz.v1.Channelz/GetSocket",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ChannelzServer).GetSocket(ctx, req.(*GetSocketRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-var _Channelz_serviceDesc = grpc.ServiceDesc{
-	ServiceName: "grpc.channelz.v1.Channelz",
-	HandlerType: (*ChannelzServer)(nil),
-	Methods: []grpc.MethodDesc{
-		{
-			MethodName: "GetTopChannels",
-			Handler:    _Channelz_GetTopChannels_Handler,
-		},
-		{
-			MethodName: "GetServers",
-			Handler:    _Channelz_GetServers_Handler,
-		},
-		{
-			MethodName: "GetServer",
-			Handler:    _Channelz_GetServer_Handler,
-		},
-		{
-			MethodName: "GetServerSockets",
-			Handler:    _Channelz_GetServerSockets_Handler,
-		},
-		{
-			MethodName: "GetChannel",
-			Handler:    _Channelz_GetChannel_Handler,
-		},
-		{
-			MethodName: "GetSubchannel",
-			Handler:    _Channelz_GetSubchannel_Handler,
-		},
-		{
-			MethodName: "GetSocket",
-			Handler:    _Channelz_GetSocket_Handler,
-		},
-	},
-	Streams:  []grpc.StreamDesc{},
-	Metadata: "grpc/channelz/v1/channelz.proto",
-}
diff --git a/channelz/grpc_channelz_v1/channelz_grpc.pb.go b/channelz/grpc_channelz_v1/channelz_grpc.pb.go
index bc6083b..791151f 100644
--- a/channelz/grpc_channelz_v1/channelz_grpc.pb.go
+++ b/channelz/grpc_channelz_v1/channelz_grpc.pb.go
@@ -13,6 +13,126 @@
 // is compatible with the grpc package it is being compiled against.
 const _ = grpc.SupportPackageIsVersion7
 
+// ChannelzClient is the client API for Channelz service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type ChannelzClient interface {
+	// Gets all root channels (i.e. channels the application has directly
+	// created). This does not include subchannels nor non-top level channels.
+	GetTopChannels(ctx context.Context, in *GetTopChannelsRequest, opts ...grpc.CallOption) (*GetTopChannelsResponse, error)
+	// Gets all servers that exist in the process.
+	GetServers(ctx context.Context, in *GetServersRequest, opts ...grpc.CallOption) (*GetServersResponse, error)
+	// Returns a single Server, or else a NOT_FOUND code.
+	GetServer(ctx context.Context, in *GetServerRequest, opts ...grpc.CallOption) (*GetServerResponse, error)
+	// Gets all server sockets that exist in the process.
+	GetServerSockets(ctx context.Context, in *GetServerSocketsRequest, opts ...grpc.CallOption) (*GetServerSocketsResponse, error)
+	// Returns a single Channel, or else a NOT_FOUND code.
+	GetChannel(ctx context.Context, in *GetChannelRequest, opts ...grpc.CallOption) (*GetChannelResponse, error)
+	// Returns a single Subchannel, or else a NOT_FOUND code.
+	GetSubchannel(ctx context.Context, in *GetSubchannelRequest, opts ...grpc.CallOption) (*GetSubchannelResponse, error)
+	// Returns a single Socket or else a NOT_FOUND code.
+	GetSocket(ctx context.Context, in *GetSocketRequest, opts ...grpc.CallOption) (*GetSocketResponse, error)
+}
+
+type channelzClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewChannelzClient(cc grpc.ClientConnInterface) ChannelzClient {
+	return &channelzClient{cc}
+}
+
+var channelzGetTopChannelsStreamDesc = &grpc.StreamDesc{
+	StreamName: "GetTopChannels",
+}
+
+func (c *channelzClient) GetTopChannels(ctx context.Context, in *GetTopChannelsRequest, opts ...grpc.CallOption) (*GetTopChannelsResponse, error) {
+	out := new(GetTopChannelsResponse)
+	err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetTopChannels", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+var channelzGetServersStreamDesc = &grpc.StreamDesc{
+	StreamName: "GetServers",
+}
+
+func (c *channelzClient) GetServers(ctx context.Context, in *GetServersRequest, opts ...grpc.CallOption) (*GetServersResponse, error) {
+	out := new(GetServersResponse)
+	err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetServers", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+var channelzGetServerStreamDesc = &grpc.StreamDesc{
+	StreamName: "GetServer",
+}
+
+func (c *channelzClient) GetServer(ctx context.Context, in *GetServerRequest, opts ...grpc.CallOption) (*GetServerResponse, error) {
+	out := new(GetServerResponse)
+	err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetServer", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+var channelzGetServerSocketsStreamDesc = &grpc.StreamDesc{
+	StreamName: "GetServerSockets",
+}
+
+func (c *channelzClient) GetServerSockets(ctx context.Context, in *GetServerSocketsRequest, opts ...grpc.CallOption) (*GetServerSocketsResponse, error) {
+	out := new(GetServerSocketsResponse)
+	err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetServerSockets", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+var channelzGetChannelStreamDesc = &grpc.StreamDesc{
+	StreamName: "GetChannel",
+}
+
+func (c *channelzClient) GetChannel(ctx context.Context, in *GetChannelRequest, opts ...grpc.CallOption) (*GetChannelResponse, error) {
+	out := new(GetChannelResponse)
+	err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetChannel", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+var channelzGetSubchannelStreamDesc = &grpc.StreamDesc{
+	StreamName: "GetSubchannel",
+}
+
+func (c *channelzClient) GetSubchannel(ctx context.Context, in *GetSubchannelRequest, opts ...grpc.CallOption) (*GetSubchannelResponse, error) {
+	out := new(GetSubchannelResponse)
+	err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetSubchannel", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+var channelzGetSocketStreamDesc = &grpc.StreamDesc{
+	StreamName: "GetSocket",
+}
+
+func (c *channelzClient) GetSocket(ctx context.Context, in *GetSocketRequest, opts ...grpc.CallOption) (*GetSocketResponse, error) {
+	out := new(GetSocketResponse)
+	err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetSocket", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // ChannelzService is the service API for Channelz service.
 // Fields should be assigned to their respective handler implementations only before
 // RegisterChannelzService is called.  Any unassigned fields will result in the
@@ -232,57 +352,11 @@
 	s.RegisterService(&sd, nil)
 }
 
-// NewChannelzService creates a new ChannelzService containing the
-// implemented methods of the Channelz service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewChannelzService(s interface{}) *ChannelzService {
-	ns := &ChannelzService{}
-	if h, ok := s.(interface {
-		GetTopChannels(context.Context, *GetTopChannelsRequest) (*GetTopChannelsResponse, error)
-	}); ok {
-		ns.GetTopChannels = h.GetTopChannels
-	}
-	if h, ok := s.(interface {
-		GetServers(context.Context, *GetServersRequest) (*GetServersResponse, error)
-	}); ok {
-		ns.GetServers = h.GetServers
-	}
-	if h, ok := s.(interface {
-		GetServer(context.Context, *GetServerRequest) (*GetServerResponse, error)
-	}); ok {
-		ns.GetServer = h.GetServer
-	}
-	if h, ok := s.(interface {
-		GetServerSockets(context.Context, *GetServerSocketsRequest) (*GetServerSocketsResponse, error)
-	}); ok {
-		ns.GetServerSockets = h.GetServerSockets
-	}
-	if h, ok := s.(interface {
-		GetChannel(context.Context, *GetChannelRequest) (*GetChannelResponse, error)
-	}); ok {
-		ns.GetChannel = h.GetChannel
-	}
-	if h, ok := s.(interface {
-		GetSubchannel(context.Context, *GetSubchannelRequest) (*GetSubchannelResponse, error)
-	}); ok {
-		ns.GetSubchannel = h.GetSubchannel
-	}
-	if h, ok := s.(interface {
-		GetSocket(context.Context, *GetSocketRequest) (*GetSocketResponse, error)
-	}); ok {
-		ns.GetSocket = h.GetSocket
-	}
-	return ns
-}
-
-// UnstableChannelzService is the service API for Channelz service.
+// ChannelzServer is the service API for Channelz service.
 // New methods may be added to this interface if they are added to the service
 // definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableChannelzService interface {
+// use of this type is not recommended unless you own the service definition.
+type ChannelzServer interface {
 	// Gets all root channels (i.e. channels the application has directly
 	// created). This does not include subchannels nor non-top level channels.
 	GetTopChannels(context.Context, *GetTopChannelsRequest) (*GetTopChannelsResponse, error)
@@ -299,3 +373,44 @@
 	// Returns a single Socket or else a NOT_FOUND code.
 	GetSocket(context.Context, *GetSocketRequest) (*GetSocketResponse, error)
 }
+
+// UnimplementedChannelzServer can be embedded to have forward compatible implementations of
+// ChannelzServer
+type UnimplementedChannelzServer struct {
+}
+
+func (*UnimplementedChannelzServer) GetTopChannels(context.Context, *GetTopChannelsRequest) (*GetTopChannelsResponse, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetTopChannels not implemented")
+}
+func (*UnimplementedChannelzServer) GetServers(context.Context, *GetServersRequest) (*GetServersResponse, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetServers not implemented")
+}
+func (*UnimplementedChannelzServer) GetServer(context.Context, *GetServerRequest) (*GetServerResponse, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetServer not implemented")
+}
+func (*UnimplementedChannelzServer) GetServerSockets(context.Context, *GetServerSocketsRequest) (*GetServerSocketsResponse, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetServerSockets not implemented")
+}
+func (*UnimplementedChannelzServer) GetChannel(context.Context, *GetChannelRequest) (*GetChannelResponse, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetChannel not implemented")
+}
+func (*UnimplementedChannelzServer) GetSubchannel(context.Context, *GetSubchannelRequest) (*GetSubchannelResponse, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetSubchannel not implemented")
+}
+func (*UnimplementedChannelzServer) GetSocket(context.Context, *GetSocketRequest) (*GetSocketResponse, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetSocket not implemented")
+}
+
+// RegisterChannelzServer registers a service implementation with a gRPC server.
+func RegisterChannelzServer(s grpc.ServiceRegistrar, srv ChannelzServer) {
+	str := &ChannelzService{
+		GetTopChannels:   srv.GetTopChannels,
+		GetServers:       srv.GetServers,
+		GetServer:        srv.GetServer,
+		GetServerSockets: srv.GetServerSockets,
+		GetChannel:       srv.GetChannel,
+		GetSubchannel:    srv.GetSubchannel,
+		GetSocket:        srv.GetSocket,
+	}
+	RegisterChannelzService(s, str)
+}
diff --git a/cmd/protoc-gen-go-grpc/README.md b/cmd/protoc-gen-go-grpc/README.md
index 6d047f1..d5b0a3b 100644
--- a/cmd/protoc-gen-go-grpc/README.md
+++ b/cmd/protoc-gen-go-grpc/README.md
@@ -98,7 +98,7 @@
 
 // Optional; not recommended: to guarantee myEchoService fully implements
 // EchoService:
-var _ pb.UnstableEchoService = &myEchoService{}
+var _ pb.EchoServer = &myEchoService{}
 
 func main() {
      // ...
@@ -111,7 +111,7 @@
 
 
      // Optional: to gracefully detect missing methods:
-     if _, ok := &myEchoService{}.(pb.UnstableEchoService); !ok {
+     if _, ok := &myEchoService{}.(pb.EchoServer); !ok {
         fmt.Println("myEchoService does not implement all methods of EchoService.")
      }
 
diff --git a/cmd/protoc-gen-go-grpc/grpc.go b/cmd/protoc-gen-go-grpc/grpc.go
index 13bd755..358bae2 100644
--- a/cmd/protoc-gen-go-grpc/grpc.go
+++ b/cmd/protoc-gen-go-grpc/grpc.go
@@ -63,14 +63,13 @@
 	for _, service := range file.Services {
 		genClient(gen, file, g, service)
 		genService(gen, file, g, service)
-		genUnstableServiceInterface(gen, file, g, service)
+		if *genUnstableServerInterfaces {
+			genUnstableServerInterface(gen, file, g, service)
+		}
 	}
 }
 
 func genClient(gen *protogen.Plugin, file *protogen.File, g *protogen.GeneratedFile, service *protogen.Service) {
-	if *migrationMode {
-		return
-	}
 	clientName := service.GoName + "Client"
 
 	g.P("// ", clientName, " is the client API for ", service.GoName, " service.")
@@ -258,9 +257,6 @@
 
 	// Service registration.
 	genRegisterFunction(gen, file, g, service)
-
-	// Short-cut service constructor.
-	genServiceConstructor(gen, g, service)
 }
 
 func genRegisterFunction(gen *protogen.Plugin, file *protogen.File, g *protogen.GeneratedFile, service *protogen.Service) {
@@ -324,40 +320,21 @@
 	g.P()
 }
 
-func genServiceConstructor(gen *protogen.Plugin, g *protogen.GeneratedFile, service *protogen.Service) {
-	g.P("// New", service.GoName, "Service creates a new ", service.GoName, "Service containing the")
-	g.P("// implemented methods of the ", service.GoName, " service in s.  Any unimplemented")
-	g.P("// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.")
-	g.P("// This includes situations where the method handler is misspelled or has the wrong")
-	g.P("// signature.  For this reason, this function should be used with great care and")
-	g.P("// is not recommended to be used by most users.")
-	g.P("func New", service.GoName, "Service(s interface{}) *", service.GoName, "Service {")
-	g.P("ns := &", service.GoName, "Service{}")
-	for _, method := range service.Methods {
-		g.P("if h, ok := s.(interface {", methodSignature(g, method), "}); ok {")
-		g.P("ns.", method.GoName, " = h.", method.GoName)
-		g.P("}")
-	}
-	g.P("return ns")
-	g.P("}")
-	g.P()
-}
-
-func genUnstableServiceInterface(gen *protogen.Plugin, file *protogen.File, g *protogen.GeneratedFile, service *protogen.Service) {
+func genUnstableServerInterface(gen *protogen.Plugin, file *protogen.File, g *protogen.GeneratedFile, service *protogen.Service) {
 	// Service interface.
-	serviceType := service.GoName + "Service"
-	g.P("// Unstable", serviceType, " is the service API for ", service.GoName, " service.")
+	serverType := service.GoName + "Server"
+	g.P("// ", serverType, " is the service API for ", service.GoName, " service.")
 	g.P("// New methods may be added to this interface if they are added to the service")
 	g.P("// definition, which is not a backward-compatible change.  For this reason, ")
-	g.P("// use of this type is not recommended.")
+	g.P("// use of this type is not recommended unless you own the service definition.")
 	if service.Desc.Options().(*descriptorpb.ServiceOptions).GetDeprecated() {
 		g.P("//")
 		g.P(deprecationComment)
 	}
-	g.Annotate("Unstable"+serviceType, service.Location)
-	g.P("type Unstable", serviceType, " interface {")
+	g.Annotate(serverType, service.Location)
+	g.P("type ", serverType, " interface {")
 	for _, method := range service.Methods {
-		g.Annotate("Unstable"+serviceType+"."+method.GoName, method.Location)
+		g.Annotate(serverType+"."+method.GoName, method.Location)
 		if method.Desc.Options().(*descriptorpb.MethodOptions).GetDeprecated() {
 			g.P(deprecationComment)
 		}
@@ -366,6 +343,50 @@
 	}
 	g.P("}")
 	g.P()
+
+	// Unimplemented implementation.
+	genUnimplementedServer(gen, file, g, service)
+
+	// Service registration.
+	genUnstableRegisterFunction(gen, file, g, service)
+}
+
+func genUnimplementedServer(gen *protogen.Plugin, file *protogen.File, g *protogen.GeneratedFile, service *protogen.Service) {
+	// Server Unimplemented struct for forward compatibility.
+	serverType := service.GoName + "Server"
+	g.P("// Unimplemented", serverType, " can be embedded to have forward compatible implementations of")
+	g.P("// ", serverType)
+	g.P("type Unimplemented", serverType, " struct {")
+	g.P("}")
+	g.P()
+	for _, method := range service.Methods {
+		nilArg := ""
+		if !method.Desc.IsStreamingClient() && !method.Desc.IsStreamingServer() {
+			nilArg = "nil,"
+		}
+		g.P("func (Unimplemented", serverType, ") ", methodSignature(g, method), "{")
+		g.P("return ", nilArg, statusPackage.Ident("Errorf"), "(", codesPackage.Ident("Unimplemented"), `, "method `, method.GoName, ` not implemented")`)
+		g.P("}")
+	}
+	g.P()
+}
+
+func genUnstableRegisterFunction(gen *protogen.Plugin, file *protogen.File, g *protogen.GeneratedFile, service *protogen.Service) {
+	serverType := service.GoName + "Server"
+	g.P("// Register", serverType, " registers a service implementation with a gRPC server.")
+	if service.Desc.Options().(*descriptorpb.ServiceOptions).GetDeprecated() {
+		g.P("//")
+		g.P(deprecationComment)
+	}
+	g.P("func Register", serverType, "(s ", grpcPackage.Ident("ServiceRegistrar"), ", srv ", serverType, ") {")
+	g.P("str := &", service.GoName, "Service{")
+	for _, method := range service.Methods {
+		g.P(method.GoName, ": srv.", method.GoName, ",")
+	}
+	g.P("}")
+	g.P("Register", service.GoName, "Service(s, str)")
+	g.P("}")
+	g.P()
 }
 
 func methodSignature(g *protogen.GeneratedFile, method *protogen.Method) string {
@@ -452,9 +473,6 @@
 }
 
 func genServerStreamTypes(gen *protogen.Plugin, g *protogen.GeneratedFile, method *protogen.Method) {
-	if *migrationMode {
-		return
-	}
 	if !method.Desc.IsStreamingClient() && !method.Desc.IsStreamingServer() {
 		// Unary method
 		return
diff --git a/cmd/protoc-gen-go-grpc/main.go b/cmd/protoc-gen-go-grpc/main.go
index 0d7e76c..65896f1 100644
--- a/cmd/protoc-gen-go-grpc/main.go
+++ b/cmd/protoc-gen-go-grpc/main.go
@@ -37,11 +37,11 @@
 	"google.golang.org/protobuf/types/pluginpb"
 )
 
-var migrationMode *bool
+var genUnstableServerInterfaces *bool
 
 func main() {
 	var flags flag.FlagSet
-	migrationMode = flags.Bool("migration_mode", false, "set to generate new symbols only; requires symbols produced by legacy protoc-gen-go")
+	genUnstableServerInterfaces = flags.Bool("gen_unstable_server_interfaces", false, `set to generate legacy "Server" interfaces which do not guarantee backward compatibility`)
 
 	protogen.Options{
 		ParamFunc: flags.Set,
diff --git a/credentials/alts/internal/proto/grpc_gcp/handshaker.pb.go b/credentials/alts/internal/proto/grpc_gcp/handshaker.pb.go
index a2060de..6d9c304 100644
--- a/credentials/alts/internal/proto/grpc_gcp/handshaker.pb.go
+++ b/credentials/alts/internal/proto/grpc_gcp/handshaker.pb.go
@@ -4,12 +4,8 @@
 package grpc_gcp
 
 import (
-	context "context"
 	fmt "fmt"
 	proto "github.com/golang/protobuf/proto"
-	grpc "google.golang.org/grpc"
-	codes "google.golang.org/grpc/codes"
-	status "google.golang.org/grpc/status"
 	math "math"
 )
 
@@ -979,127 +975,3 @@
 	0x5f, 0xef, 0xa8, 0xf5, 0x83, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc1, 0xf9, 0x9d, 0xf2, 0xd9,
 	0x0b, 0x00, 0x00,
 }
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConnInterface
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion6
-
-// HandshakerServiceClient is the client API for HandshakerService service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type HandshakerServiceClient interface {
-	// Handshaker service accepts a stream of handshaker request, returning a
-	// stream of handshaker response. Client is expected to send exactly one
-	// message with either client_start or server_start followed by one or more
-	// messages with next. Each time client sends a request, the handshaker
-	// service expects to respond. Client does not have to wait for service's
-	// response before sending next request.
-	DoHandshake(ctx context.Context, opts ...grpc.CallOption) (HandshakerService_DoHandshakeClient, error)
-}
-
-type handshakerServiceClient struct {
-	cc grpc.ClientConnInterface
-}
-
-func NewHandshakerServiceClient(cc grpc.ClientConnInterface) HandshakerServiceClient {
-	return &handshakerServiceClient{cc}
-}
-
-func (c *handshakerServiceClient) DoHandshake(ctx context.Context, opts ...grpc.CallOption) (HandshakerService_DoHandshakeClient, error) {
-	stream, err := c.cc.NewStream(ctx, &_HandshakerService_serviceDesc.Streams[0], "/grpc.gcp.HandshakerService/DoHandshake", opts...)
-	if err != nil {
-		return nil, err
-	}
-	x := &handshakerServiceDoHandshakeClient{stream}
-	return x, nil
-}
-
-type HandshakerService_DoHandshakeClient interface {
-	Send(*HandshakerReq) error
-	Recv() (*HandshakerResp, error)
-	grpc.ClientStream
-}
-
-type handshakerServiceDoHandshakeClient struct {
-	grpc.ClientStream
-}
-
-func (x *handshakerServiceDoHandshakeClient) Send(m *HandshakerReq) error {
-	return x.ClientStream.SendMsg(m)
-}
-
-func (x *handshakerServiceDoHandshakeClient) Recv() (*HandshakerResp, error) {
-	m := new(HandshakerResp)
-	if err := x.ClientStream.RecvMsg(m); err != nil {
-		return nil, err
-	}
-	return m, nil
-}
-
-// HandshakerServiceServer is the server API for HandshakerService service.
-type HandshakerServiceServer interface {
-	// Handshaker service accepts a stream of handshaker request, returning a
-	// stream of handshaker response. Client is expected to send exactly one
-	// message with either client_start or server_start followed by one or more
-	// messages with next. Each time client sends a request, the handshaker
-	// service expects to respond. Client does not have to wait for service's
-	// response before sending next request.
-	DoHandshake(HandshakerService_DoHandshakeServer) error
-}
-
-// UnimplementedHandshakerServiceServer can be embedded to have forward compatible implementations.
-type UnimplementedHandshakerServiceServer struct {
-}
-
-func (*UnimplementedHandshakerServiceServer) DoHandshake(srv HandshakerService_DoHandshakeServer) error {
-	return status.Errorf(codes.Unimplemented, "method DoHandshake not implemented")
-}
-
-func RegisterHandshakerServiceServer(s *grpc.Server, srv HandshakerServiceServer) {
-	s.RegisterService(&_HandshakerService_serviceDesc, srv)
-}
-
-func _HandshakerService_DoHandshake_Handler(srv interface{}, stream grpc.ServerStream) error {
-	return srv.(HandshakerServiceServer).DoHandshake(&handshakerServiceDoHandshakeServer{stream})
-}
-
-type HandshakerService_DoHandshakeServer interface {
-	Send(*HandshakerResp) error
-	Recv() (*HandshakerReq, error)
-	grpc.ServerStream
-}
-
-type handshakerServiceDoHandshakeServer struct {
-	grpc.ServerStream
-}
-
-func (x *handshakerServiceDoHandshakeServer) Send(m *HandshakerResp) error {
-	return x.ServerStream.SendMsg(m)
-}
-
-func (x *handshakerServiceDoHandshakeServer) Recv() (*HandshakerReq, error) {
-	m := new(HandshakerReq)
-	if err := x.ServerStream.RecvMsg(m); err != nil {
-		return nil, err
-	}
-	return m, nil
-}
-
-var _HandshakerService_serviceDesc = grpc.ServiceDesc{
-	ServiceName: "grpc.gcp.HandshakerService",
-	HandlerType: (*HandshakerServiceServer)(nil),
-	Methods:     []grpc.MethodDesc{},
-	Streams: []grpc.StreamDesc{
-		{
-			StreamName:    "DoHandshake",
-			Handler:       _HandshakerService_DoHandshake_Handler,
-			ServerStreams: true,
-			ClientStreams: true,
-		},
-	},
-	Metadata: "grpc/gcp/handshaker.proto",
-}
diff --git a/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go b/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go
index d6f3af2..d2f2971 100644
--- a/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go
+++ b/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go
@@ -3,6 +3,7 @@
 package grpc_gcp
 
 import (
+	context "context"
 	grpc "google.golang.org/grpc"
 	codes "google.golang.org/grpc/codes"
 	status "google.golang.org/grpc/status"
@@ -12,6 +13,64 @@
 // is compatible with the grpc package it is being compiled against.
 const _ = grpc.SupportPackageIsVersion7
 
+// HandshakerServiceClient is the client API for HandshakerService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type HandshakerServiceClient interface {
+	// Handshaker service accepts a stream of handshaker request, returning a
+	// stream of handshaker response. Client is expected to send exactly one
+	// message with either client_start or server_start followed by one or more
+	// messages with next. Each time client sends a request, the handshaker
+	// service expects to respond. Client does not have to wait for service's
+	// response before sending next request.
+	DoHandshake(ctx context.Context, opts ...grpc.CallOption) (HandshakerService_DoHandshakeClient, error)
+}
+
+type handshakerServiceClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewHandshakerServiceClient(cc grpc.ClientConnInterface) HandshakerServiceClient {
+	return &handshakerServiceClient{cc}
+}
+
+var handshakerServiceDoHandshakeStreamDesc = &grpc.StreamDesc{
+	StreamName:    "DoHandshake",
+	ServerStreams: true,
+	ClientStreams: true,
+}
+
+func (c *handshakerServiceClient) DoHandshake(ctx context.Context, opts ...grpc.CallOption) (HandshakerService_DoHandshakeClient, error) {
+	stream, err := c.cc.NewStream(ctx, handshakerServiceDoHandshakeStreamDesc, "/grpc.gcp.HandshakerService/DoHandshake", opts...)
+	if err != nil {
+		return nil, err
+	}
+	x := &handshakerServiceDoHandshakeClient{stream}
+	return x, nil
+}
+
+type HandshakerService_DoHandshakeClient interface {
+	Send(*HandshakerReq) error
+	Recv() (*HandshakerResp, error)
+	grpc.ClientStream
+}
+
+type handshakerServiceDoHandshakeClient struct {
+	grpc.ClientStream
+}
+
+func (x *handshakerServiceDoHandshakeClient) Send(m *HandshakerReq) error {
+	return x.ClientStream.SendMsg(m)
+}
+
+func (x *handshakerServiceDoHandshakeClient) Recv() (*HandshakerResp, error) {
+	m := new(HandshakerResp)
+	if err := x.ClientStream.RecvMsg(m); err != nil {
+		return nil, err
+	}
+	return m, nil
+}
+
 // HandshakerServiceService is the service API for HandshakerService service.
 // Fields should be assigned to their respective handler implementations only before
 // RegisterHandshakerServiceService is called.  Any unassigned fields will result in the
@@ -30,6 +89,28 @@
 	return s.DoHandshake(&handshakerServiceDoHandshakeServer{stream})
 }
 
+type HandshakerService_DoHandshakeServer interface {
+	Send(*HandshakerResp) error
+	Recv() (*HandshakerReq, error)
+	grpc.ServerStream
+}
+
+type handshakerServiceDoHandshakeServer struct {
+	grpc.ServerStream
+}
+
+func (x *handshakerServiceDoHandshakeServer) Send(m *HandshakerResp) error {
+	return x.ServerStream.SendMsg(m)
+}
+
+func (x *handshakerServiceDoHandshakeServer) Recv() (*HandshakerReq, error) {
+	m := new(HandshakerReq)
+	if err := x.ServerStream.RecvMsg(m); err != nil {
+		return nil, err
+	}
+	return m, nil
+}
+
 // RegisterHandshakerServiceService registers a service implementation with a gRPC server.
 func RegisterHandshakerServiceService(s grpc.ServiceRegistrar, srv *HandshakerServiceService) {
 	srvCopy := *srv
@@ -55,27 +136,11 @@
 	s.RegisterService(&sd, nil)
 }
 
-// NewHandshakerServiceService creates a new HandshakerServiceService containing the
-// implemented methods of the HandshakerService service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewHandshakerServiceService(s interface{}) *HandshakerServiceService {
-	ns := &HandshakerServiceService{}
-	if h, ok := s.(interface {
-		DoHandshake(HandshakerService_DoHandshakeServer) error
-	}); ok {
-		ns.DoHandshake = h.DoHandshake
-	}
-	return ns
-}
-
-// UnstableHandshakerServiceService is the service API for HandshakerService service.
+// HandshakerServiceServer is the service API for HandshakerService service.
 // New methods may be added to this interface if they are added to the service
 // definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableHandshakerServiceService interface {
+// use of this type is not recommended unless you own the service definition.
+type HandshakerServiceServer interface {
 	// Handshaker service accepts a stream of handshaker request, returning a
 	// stream of handshaker response. Client is expected to send exactly one
 	// message with either client_start or server_start followed by one or more
@@ -84,3 +149,20 @@
 	// response before sending next request.
 	DoHandshake(HandshakerService_DoHandshakeServer) error
 }
+
+// UnimplementedHandshakerServiceServer can be embedded to have forward compatible implementations of
+// HandshakerServiceServer
+type UnimplementedHandshakerServiceServer struct {
+}
+
+func (*UnimplementedHandshakerServiceServer) DoHandshake(HandshakerService_DoHandshakeServer) error {
+	return status.Errorf(codes.Unimplemented, "method DoHandshake not implemented")
+}
+
+// RegisterHandshakerServiceServer registers a service implementation with a gRPC server.
+func RegisterHandshakerServiceServer(s grpc.ServiceRegistrar, srv HandshakerServiceServer) {
+	str := &HandshakerServiceService{
+		DoHandshake: srv.DoHandshake,
+	}
+	RegisterHandshakerServiceService(s, str)
+}
diff --git a/credentials/tls/certprovider/meshca/internal/v1/meshca.pb.go b/credentials/tls/certprovider/meshca/internal/v1/meshca.pb.go
index b09de93..16122f7 100644
--- a/credentials/tls/certprovider/meshca/internal/v1/meshca.pb.go
+++ b/credentials/tls/certprovider/meshca/internal/v1/meshca.pb.go
@@ -4,13 +4,9 @@
 package google_security_meshca_v1
 
 import (
-	context "context"
 	fmt "fmt"
 	proto "github.com/golang/protobuf/proto"
 	duration "github.com/golang/protobuf/ptypes/duration"
-	grpc "google.golang.org/grpc"
-	codes "google.golang.org/grpc/codes"
-	status "google.golang.org/grpc/status"
 	math "math"
 )
 
@@ -157,87 +153,3 @@
 	0x75, 0x36, 0xec, 0xba, 0x62, 0xee, 0x66, 0x99, 0x93, 0xe5, 0x45, 0xb7, 0xcf, 0xc3, 0x77, 0x00,
 	0x00, 0x00, 0xff, 0xff, 0xb7, 0x0d, 0xfd, 0xff, 0xf7, 0x01, 0x00, 0x00,
 }
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConnInterface
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion6
-
-// MeshCertificateServiceClient is the client API for MeshCertificateService service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type MeshCertificateServiceClient interface {
-	// Using provided CSR, returns a signed certificate that represents a GCP
-	// service account identity.
-	CreateCertificate(ctx context.Context, in *MeshCertificateRequest, opts ...grpc.CallOption) (*MeshCertificateResponse, error)
-}
-
-type meshCertificateServiceClient struct {
-	cc grpc.ClientConnInterface
-}
-
-func NewMeshCertificateServiceClient(cc grpc.ClientConnInterface) MeshCertificateServiceClient {
-	return &meshCertificateServiceClient{cc}
-}
-
-func (c *meshCertificateServiceClient) CreateCertificate(ctx context.Context, in *MeshCertificateRequest, opts ...grpc.CallOption) (*MeshCertificateResponse, error) {
-	out := new(MeshCertificateResponse)
-	err := c.cc.Invoke(ctx, "/google.security.meshca.v1.MeshCertificateService/CreateCertificate", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-// MeshCertificateServiceServer is the server API for MeshCertificateService service.
-type MeshCertificateServiceServer interface {
-	// Using provided CSR, returns a signed certificate that represents a GCP
-	// service account identity.
-	CreateCertificate(context.Context, *MeshCertificateRequest) (*MeshCertificateResponse, error)
-}
-
-// UnimplementedMeshCertificateServiceServer can be embedded to have forward compatible implementations.
-type UnimplementedMeshCertificateServiceServer struct {
-}
-
-func (*UnimplementedMeshCertificateServiceServer) CreateCertificate(ctx context.Context, req *MeshCertificateRequest) (*MeshCertificateResponse, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method CreateCertificate not implemented")
-}
-
-func RegisterMeshCertificateServiceServer(s *grpc.Server, srv MeshCertificateServiceServer) {
-	s.RegisterService(&_MeshCertificateService_serviceDesc, srv)
-}
-
-func _MeshCertificateService_CreateCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(MeshCertificateRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(MeshCertificateServiceServer).CreateCertificate(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/google.security.meshca.v1.MeshCertificateService/CreateCertificate",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(MeshCertificateServiceServer).CreateCertificate(ctx, req.(*MeshCertificateRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-var _MeshCertificateService_serviceDesc = grpc.ServiceDesc{
-	ServiceName: "google.security.meshca.v1.MeshCertificateService",
-	HandlerType: (*MeshCertificateServiceServer)(nil),
-	Methods: []grpc.MethodDesc{
-		{
-			MethodName: "CreateCertificate",
-			Handler:    _MeshCertificateService_CreateCertificate_Handler,
-		},
-	},
-	Streams:  []grpc.StreamDesc{},
-	Metadata: "istio/google/security/meshca/v1/meshca.proto",
-}
diff --git a/credentials/tls/certprovider/meshca/internal/v1/meshca_grpc.pb.go b/credentials/tls/certprovider/meshca/internal/v1/meshca_grpc.pb.go
index 3a82e6a..4dbb2ac 100644
--- a/credentials/tls/certprovider/meshca/internal/v1/meshca_grpc.pb.go
+++ b/credentials/tls/certprovider/meshca/internal/v1/meshca_grpc.pb.go
@@ -13,6 +13,36 @@
 // is compatible with the grpc package it is being compiled against.
 const _ = grpc.SupportPackageIsVersion7
 
+// MeshCertificateServiceClient is the client API for MeshCertificateService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type MeshCertificateServiceClient interface {
+	// Using provided CSR, returns a signed certificate that represents a GCP
+	// service account identity.
+	CreateCertificate(ctx context.Context, in *MeshCertificateRequest, opts ...grpc.CallOption) (*MeshCertificateResponse, error)
+}
+
+type meshCertificateServiceClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewMeshCertificateServiceClient(cc grpc.ClientConnInterface) MeshCertificateServiceClient {
+	return &meshCertificateServiceClient{cc}
+}
+
+var meshCertificateServiceCreateCertificateStreamDesc = &grpc.StreamDesc{
+	StreamName: "CreateCertificate",
+}
+
+func (c *meshCertificateServiceClient) CreateCertificate(ctx context.Context, in *MeshCertificateRequest, opts ...grpc.CallOption) (*MeshCertificateResponse, error) {
+	out := new(MeshCertificateResponse)
+	err := c.cc.Invoke(ctx, "/google.security.meshca.v1.MeshCertificateService/CreateCertificate", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // MeshCertificateServiceService is the service API for MeshCertificateService service.
 // Fields should be assigned to their respective handler implementations only before
 // RegisterMeshCertificateServiceService is called.  Any unassigned fields will result in the
@@ -64,28 +94,29 @@
 	s.RegisterService(&sd, nil)
 }
 
-// NewMeshCertificateServiceService creates a new MeshCertificateServiceService containing the
-// implemented methods of the MeshCertificateService service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewMeshCertificateServiceService(s interface{}) *MeshCertificateServiceService {
-	ns := &MeshCertificateServiceService{}
-	if h, ok := s.(interface {
-		CreateCertificate(context.Context, *MeshCertificateRequest) (*MeshCertificateResponse, error)
-	}); ok {
-		ns.CreateCertificate = h.CreateCertificate
-	}
-	return ns
-}
-
-// UnstableMeshCertificateServiceService is the service API for MeshCertificateService service.
+// MeshCertificateServiceServer is the service API for MeshCertificateService service.
 // New methods may be added to this interface if they are added to the service
 // definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableMeshCertificateServiceService interface {
+// use of this type is not recommended unless you own the service definition.
+type MeshCertificateServiceServer interface {
 	// Using provided CSR, returns a signed certificate that represents a GCP
 	// service account identity.
 	CreateCertificate(context.Context, *MeshCertificateRequest) (*MeshCertificateResponse, error)
 }
+
+// UnimplementedMeshCertificateServiceServer can be embedded to have forward compatible implementations of
+// MeshCertificateServiceServer
+type UnimplementedMeshCertificateServiceServer struct {
+}
+
+func (*UnimplementedMeshCertificateServiceServer) CreateCertificate(context.Context, *MeshCertificateRequest) (*MeshCertificateResponse, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method CreateCertificate not implemented")
+}
+
+// RegisterMeshCertificateServiceServer registers a service implementation with a gRPC server.
+func RegisterMeshCertificateServiceServer(s grpc.ServiceRegistrar, srv MeshCertificateServiceServer) {
+	str := &MeshCertificateServiceService{
+		CreateCertificate: srv.CreateCertificate,
+	}
+	RegisterMeshCertificateServiceService(s, str)
+}
diff --git a/examples/features/proto/echo/echo_grpc.pb.go b/examples/features/proto/echo/echo_grpc.pb.go
index d1d6cf0..ff30c65 100644
--- a/examples/features/proto/echo/echo_grpc.pb.go
+++ b/examples/features/proto/echo/echo_grpc.pb.go
@@ -318,49 +318,3 @@
 
 	s.RegisterService(&sd, nil)
 }
-
-// NewEchoService creates a new EchoService containing the
-// implemented methods of the Echo service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewEchoService(s interface{}) *EchoService {
-	ns := &EchoService{}
-	if h, ok := s.(interface {
-		UnaryEcho(context.Context, *EchoRequest) (*EchoResponse, error)
-	}); ok {
-		ns.UnaryEcho = h.UnaryEcho
-	}
-	if h, ok := s.(interface {
-		ServerStreamingEcho(*EchoRequest, Echo_ServerStreamingEchoServer) error
-	}); ok {
-		ns.ServerStreamingEcho = h.ServerStreamingEcho
-	}
-	if h, ok := s.(interface {
-		ClientStreamingEcho(Echo_ClientStreamingEchoServer) error
-	}); ok {
-		ns.ClientStreamingEcho = h.ClientStreamingEcho
-	}
-	if h, ok := s.(interface {
-		BidirectionalStreamingEcho(Echo_BidirectionalStreamingEchoServer) error
-	}); ok {
-		ns.BidirectionalStreamingEcho = h.BidirectionalStreamingEcho
-	}
-	return ns
-}
-
-// UnstableEchoService is the service API for Echo service.
-// New methods may be added to this interface if they are added to the service
-// definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableEchoService interface {
-	// UnaryEcho is unary echo.
-	UnaryEcho(context.Context, *EchoRequest) (*EchoResponse, error)
-	// ServerStreamingEcho is server side streaming.
-	ServerStreamingEcho(*EchoRequest, Echo_ServerStreamingEchoServer) error
-	// ClientStreamingEcho is client side streaming.
-	ClientStreamingEcho(Echo_ClientStreamingEchoServer) error
-	// BidirectionalStreamingEcho is bidi streaming.
-	BidirectionalStreamingEcho(Echo_BidirectionalStreamingEchoServer) error
-}
diff --git a/examples/helloworld/helloworld/helloworld_grpc.pb.go b/examples/helloworld/helloworld/helloworld_grpc.pb.go
index 3a88bb1..78d6025 100644
--- a/examples/helloworld/helloworld/helloworld_grpc.pb.go
+++ b/examples/helloworld/helloworld/helloworld_grpc.pb.go
@@ -91,28 +91,3 @@
 
 	s.RegisterService(&sd, nil)
 }
-
-// NewGreeterService creates a new GreeterService containing the
-// implemented methods of the Greeter service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewGreeterService(s interface{}) *GreeterService {
-	ns := &GreeterService{}
-	if h, ok := s.(interface {
-		SayHello(context.Context, *HelloRequest) (*HelloReply, error)
-	}); ok {
-		ns.SayHello = h.SayHello
-	}
-	return ns
-}
-
-// UnstableGreeterService is the service API for Greeter service.
-// New methods may be added to this interface if they are added to the service
-// definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableGreeterService interface {
-	// Sends a greeting
-	SayHello(context.Context, *HelloRequest) (*HelloReply, error)
-}
diff --git a/examples/route_guide/routeguide/route_guide_grpc.pb.go b/examples/route_guide/routeguide/route_guide_grpc.pb.go
index eb406ec..bbcfe7d 100644
--- a/examples/route_guide/routeguide/route_guide_grpc.pb.go
+++ b/examples/route_guide/routeguide/route_guide_grpc.pb.go
@@ -350,65 +350,3 @@
 
 	s.RegisterService(&sd, nil)
 }
-
-// NewRouteGuideService creates a new RouteGuideService containing the
-// implemented methods of the RouteGuide service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewRouteGuideService(s interface{}) *RouteGuideService {
-	ns := &RouteGuideService{}
-	if h, ok := s.(interface {
-		GetFeature(context.Context, *Point) (*Feature, error)
-	}); ok {
-		ns.GetFeature = h.GetFeature
-	}
-	if h, ok := s.(interface {
-		ListFeatures(*Rectangle, RouteGuide_ListFeaturesServer) error
-	}); ok {
-		ns.ListFeatures = h.ListFeatures
-	}
-	if h, ok := s.(interface {
-		RecordRoute(RouteGuide_RecordRouteServer) error
-	}); ok {
-		ns.RecordRoute = h.RecordRoute
-	}
-	if h, ok := s.(interface {
-		RouteChat(RouteGuide_RouteChatServer) error
-	}); ok {
-		ns.RouteChat = h.RouteChat
-	}
-	return ns
-}
-
-// UnstableRouteGuideService is the service API for RouteGuide service.
-// New methods may be added to this interface if they are added to the service
-// definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableRouteGuideService interface {
-	// A simple RPC.
-	//
-	// Obtains the feature at a given position.
-	//
-	// A feature with an empty name is returned if there's no feature at the given
-	// position.
-	GetFeature(context.Context, *Point) (*Feature, error)
-	// A server-to-client streaming RPC.
-	//
-	// Obtains the Features available within the given Rectangle.  Results are
-	// streamed rather than returned at once (e.g. in a response message with a
-	// repeated field), as the rectangle may cover a large area and contain a
-	// huge number of features.
-	ListFeatures(*Rectangle, RouteGuide_ListFeaturesServer) error
-	// A client-to-server streaming RPC.
-	//
-	// Accepts a stream of Points on a route being traversed, returning a
-	// RouteSummary when traversal is completed.
-	RecordRoute(RouteGuide_RecordRouteServer) error
-	// A Bidirectional streaming RPC.
-	//
-	// Accepts a stream of RouteNotes sent while a route is being traversed,
-	// while receiving other RouteNotes (e.g. from other users).
-	RouteChat(RouteGuide_RouteChatServer) error
-}
diff --git a/examples/route_guide/server/server.go b/examples/route_guide/server/server.go
index 7c959dd..3c0775e 100644
--- a/examples/route_guide/server/server.go
+++ b/examples/route_guide/server/server.go
@@ -60,6 +60,15 @@
 	routeNotes map[string][]*pb.RouteNote
 }
 
+func (s *routeGuideServer) Svc() *pb.RouteGuideService {
+	return &pb.RouteGuideService{
+		GetFeature:   s.GetFeature,
+		ListFeatures: s.ListFeatures,
+		RecordRoute:  s.RecordRoute,
+		RouteChat:    s.RouteChat,
+	}
+}
+
 // GetFeature returns the feature at the given point.
 func (s *routeGuideServer) GetFeature(ctx context.Context, point *pb.Point) (*pb.Feature, error) {
 	for _, feature := range s.savedFeatures {
@@ -237,7 +246,7 @@
 		opts = []grpc.ServerOption{grpc.Creds(creds)}
 	}
 	grpcServer := grpc.NewServer(opts...)
-	pb.RegisterRouteGuideService(grpcServer, pb.NewRouteGuideService(newServer()))
+	pb.RegisterRouteGuideService(grpcServer, newServer().Svc())
 	grpcServer.Serve(lis)
 }
 
diff --git a/health/grpc_health_v1/health.pb.go b/health/grpc_health_v1/health.pb.go
index 4c2a527..e9919c0 100644
--- a/health/grpc_health_v1/health.pb.go
+++ b/health/grpc_health_v1/health.pb.go
@@ -4,12 +4,8 @@
 package grpc_health_v1
 
 import (
-	context "context"
 	fmt "fmt"
 	proto "github.com/golang/protobuf/proto"
-	grpc "google.golang.org/grpc"
-	codes "google.golang.org/grpc/codes"
-	status "google.golang.org/grpc/status"
 	math "math"
 )
 
@@ -163,181 +159,3 @@
 	0xd3, 0x20, 0x46, 0xe8, 0x85, 0x19, 0x26, 0xb1, 0x81, 0x93, 0x83, 0x31, 0x20, 0x00, 0x00, 0xff,
 	0xff, 0x12, 0x7d, 0x96, 0xcb, 0x2d, 0x02, 0x00, 0x00,
 }
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConnInterface
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion6
-
-// HealthClient is the client API for Health service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type HealthClient interface {
-	// If the requested service is unknown, the call will fail with status
-	// NOT_FOUND.
-	Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
-	// Performs a watch for the serving status of the requested service.
-	// The server will immediately send back a message indicating the current
-	// serving status.  It will then subsequently send a new message whenever
-	// the service's serving status changes.
-	//
-	// If the requested service is unknown when the call is received, the
-	// server will send a message setting the serving status to
-	// SERVICE_UNKNOWN but will *not* terminate the call.  If at some
-	// future point, the serving status of the service becomes known, the
-	// server will send a new message with the service's serving status.
-	//
-	// If the call terminates with status UNIMPLEMENTED, then clients
-	// should assume this method is not supported and should not retry the
-	// call.  If the call terminates with any other status (including OK),
-	// clients should retry the call with appropriate exponential backoff.
-	Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error)
-}
-
-type healthClient struct {
-	cc grpc.ClientConnInterface
-}
-
-func NewHealthClient(cc grpc.ClientConnInterface) HealthClient {
-	return &healthClient{cc}
-}
-
-func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
-	out := new(HealthCheckResponse)
-	err := c.cc.Invoke(ctx, "/grpc.health.v1.Health/Check", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *healthClient) Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error) {
-	stream, err := c.cc.NewStream(ctx, &_Health_serviceDesc.Streams[0], "/grpc.health.v1.Health/Watch", opts...)
-	if err != nil {
-		return nil, err
-	}
-	x := &healthWatchClient{stream}
-	if err := x.ClientStream.SendMsg(in); err != nil {
-		return nil, err
-	}
-	if err := x.ClientStream.CloseSend(); err != nil {
-		return nil, err
-	}
-	return x, nil
-}
-
-type Health_WatchClient interface {
-	Recv() (*HealthCheckResponse, error)
-	grpc.ClientStream
-}
-
-type healthWatchClient struct {
-	grpc.ClientStream
-}
-
-func (x *healthWatchClient) Recv() (*HealthCheckResponse, error) {
-	m := new(HealthCheckResponse)
-	if err := x.ClientStream.RecvMsg(m); err != nil {
-		return nil, err
-	}
-	return m, nil
-}
-
-// HealthServer is the server API for Health service.
-type HealthServer interface {
-	// If the requested service is unknown, the call will fail with status
-	// NOT_FOUND.
-	Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
-	// Performs a watch for the serving status of the requested service.
-	// The server will immediately send back a message indicating the current
-	// serving status.  It will then subsequently send a new message whenever
-	// the service's serving status changes.
-	//
-	// If the requested service is unknown when the call is received, the
-	// server will send a message setting the serving status to
-	// SERVICE_UNKNOWN but will *not* terminate the call.  If at some
-	// future point, the serving status of the service becomes known, the
-	// server will send a new message with the service's serving status.
-	//
-	// If the call terminates with status UNIMPLEMENTED, then clients
-	// should assume this method is not supported and should not retry the
-	// call.  If the call terminates with any other status (including OK),
-	// clients should retry the call with appropriate exponential backoff.
-	Watch(*HealthCheckRequest, Health_WatchServer) error
-}
-
-// UnimplementedHealthServer can be embedded to have forward compatible implementations.
-type UnimplementedHealthServer struct {
-}
-
-func (*UnimplementedHealthServer) Check(ctx context.Context, req *HealthCheckRequest) (*HealthCheckResponse, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method Check not implemented")
-}
-func (*UnimplementedHealthServer) Watch(req *HealthCheckRequest, srv Health_WatchServer) error {
-	return status.Errorf(codes.Unimplemented, "method Watch not implemented")
-}
-
-func RegisterHealthServer(s *grpc.Server, srv HealthServer) {
-	s.RegisterService(&_Health_serviceDesc, srv)
-}
-
-func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(HealthCheckRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(HealthServer).Check(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/grpc.health.v1.Health/Check",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Health_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
-	m := new(HealthCheckRequest)
-	if err := stream.RecvMsg(m); err != nil {
-		return err
-	}
-	return srv.(HealthServer).Watch(m, &healthWatchServer{stream})
-}
-
-type Health_WatchServer interface {
-	Send(*HealthCheckResponse) error
-	grpc.ServerStream
-}
-
-type healthWatchServer struct {
-	grpc.ServerStream
-}
-
-func (x *healthWatchServer) Send(m *HealthCheckResponse) error {
-	return x.ServerStream.SendMsg(m)
-}
-
-var _Health_serviceDesc = grpc.ServiceDesc{
-	ServiceName: "grpc.health.v1.Health",
-	HandlerType: (*HealthServer)(nil),
-	Methods: []grpc.MethodDesc{
-		{
-			MethodName: "Check",
-			Handler:    _Health_Check_Handler,
-		},
-	},
-	Streams: []grpc.StreamDesc{
-		{
-			StreamName:    "Watch",
-			Handler:       _Health_Watch_Handler,
-			ServerStreams: true,
-		},
-	},
-	Metadata: "grpc/health/v1/health.proto",
-}
diff --git a/health/grpc_health_v1/health_grpc.pb.go b/health/grpc_health_v1/health_grpc.pb.go
index f848b41..fa3a6a7 100644
--- a/health/grpc_health_v1/health_grpc.pb.go
+++ b/health/grpc_health_v1/health_grpc.pb.go
@@ -13,6 +13,89 @@
 // is compatible with the grpc package it is being compiled against.
 const _ = grpc.SupportPackageIsVersion7
 
+// HealthClient is the client API for Health service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type HealthClient interface {
+	// If the requested service is unknown, the call will fail with status
+	// NOT_FOUND.
+	Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
+	// Performs a watch for the serving status of the requested service.
+	// The server will immediately send back a message indicating the current
+	// serving status.  It will then subsequently send a new message whenever
+	// the service's serving status changes.
+	//
+	// If the requested service is unknown when the call is received, the
+	// server will send a message setting the serving status to
+	// SERVICE_UNKNOWN but will *not* terminate the call.  If at some
+	// future point, the serving status of the service becomes known, the
+	// server will send a new message with the service's serving status.
+	//
+	// If the call terminates with status UNIMPLEMENTED, then clients
+	// should assume this method is not supported and should not retry the
+	// call.  If the call terminates with any other status (including OK),
+	// clients should retry the call with appropriate exponential backoff.
+	Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error)
+}
+
+type healthClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewHealthClient(cc grpc.ClientConnInterface) HealthClient {
+	return &healthClient{cc}
+}
+
+var healthCheckStreamDesc = &grpc.StreamDesc{
+	StreamName: "Check",
+}
+
+func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
+	out := new(HealthCheckResponse)
+	err := c.cc.Invoke(ctx, "/grpc.health.v1.Health/Check", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+var healthWatchStreamDesc = &grpc.StreamDesc{
+	StreamName:    "Watch",
+	ServerStreams: true,
+}
+
+func (c *healthClient) Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error) {
+	stream, err := c.cc.NewStream(ctx, healthWatchStreamDesc, "/grpc.health.v1.Health/Watch", opts...)
+	if err != nil {
+		return nil, err
+	}
+	x := &healthWatchClient{stream}
+	if err := x.ClientStream.SendMsg(in); err != nil {
+		return nil, err
+	}
+	if err := x.ClientStream.CloseSend(); err != nil {
+		return nil, err
+	}
+	return x, nil
+}
+
+type Health_WatchClient interface {
+	Recv() (*HealthCheckResponse, error)
+	grpc.ClientStream
+}
+
+type healthWatchClient struct {
+	grpc.ClientStream
+}
+
+func (x *healthWatchClient) Recv() (*HealthCheckResponse, error) {
+	m := new(HealthCheckResponse)
+	if err := x.ClientStream.RecvMsg(m); err != nil {
+		return nil, err
+	}
+	return m, nil
+}
+
 // HealthService is the service API for Health service.
 // Fields should be assigned to their respective handler implementations only before
 // RegisterHealthService is called.  Any unassigned fields will result in the
@@ -64,6 +147,19 @@
 	return s.Watch(m, &healthWatchServer{stream})
 }
 
+type Health_WatchServer interface {
+	Send(*HealthCheckResponse) error
+	grpc.ServerStream
+}
+
+type healthWatchServer struct {
+	grpc.ServerStream
+}
+
+func (x *healthWatchServer) Send(m *HealthCheckResponse) error {
+	return x.ServerStream.SendMsg(m)
+}
+
 // RegisterHealthService registers a service implementation with a gRPC server.
 func RegisterHealthService(s grpc.ServiceRegistrar, srv *HealthService) {
 	srvCopy := *srv
@@ -98,32 +194,11 @@
 	s.RegisterService(&sd, nil)
 }
 
-// NewHealthService creates a new HealthService containing the
-// implemented methods of the Health service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewHealthService(s interface{}) *HealthService {
-	ns := &HealthService{}
-	if h, ok := s.(interface {
-		Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
-	}); ok {
-		ns.Check = h.Check
-	}
-	if h, ok := s.(interface {
-		Watch(*HealthCheckRequest, Health_WatchServer) error
-	}); ok {
-		ns.Watch = h.Watch
-	}
-	return ns
-}
-
-// UnstableHealthService is the service API for Health service.
+// HealthServer is the service API for Health service.
 // New methods may be added to this interface if they are added to the service
 // definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableHealthService interface {
+// use of this type is not recommended unless you own the service definition.
+type HealthServer interface {
 	// If the requested service is unknown, the call will fail with status
 	// NOT_FOUND.
 	Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
@@ -144,3 +219,24 @@
 	// clients should retry the call with appropriate exponential backoff.
 	Watch(*HealthCheckRequest, Health_WatchServer) error
 }
+
+// UnimplementedHealthServer can be embedded to have forward compatible implementations of
+// HealthServer
+type UnimplementedHealthServer struct {
+}
+
+func (*UnimplementedHealthServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method Check not implemented")
+}
+func (*UnimplementedHealthServer) Watch(*HealthCheckRequest, Health_WatchServer) error {
+	return status.Errorf(codes.Unimplemented, "method Watch not implemented")
+}
+
+// RegisterHealthServer registers a service implementation with a gRPC server.
+func RegisterHealthServer(s grpc.ServiceRegistrar, srv HealthServer) {
+	str := &HealthService{
+		Check: srv.Check,
+		Watch: srv.Watch,
+	}
+	RegisterHealthService(s, str)
+}
diff --git a/internal/binarylog/binarylog_end2end_test.go b/internal/binarylog/binarylog_end2end_test.go
index bdce754..54dd3da 100644
--- a/internal/binarylog/binarylog_end2end_test.go
+++ b/internal/binarylog/binarylog_end2end_test.go
@@ -118,7 +118,14 @@
 	te *test
 }
 
-var _ testpb.UnstableTestServiceService = (*testServer)(nil)
+func (s *testServer) Svc() *testpb.TestServiceService {
+	return &testpb.TestServiceService{
+		UnaryCall:        s.UnaryCall,
+		FullDuplexCall:   s.FullDuplexCall,
+		ClientStreamCall: s.ClientStreamCall,
+		ServerStreamCall: s.ServerStreamCall,
+	}
+}
 
 func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
 	md, ok := metadata.FromIncomingContext(ctx)
@@ -784,7 +791,7 @@
 
 func runRPCs(t *testing.T, tc *testConfig, cc *rpcConfig) *expectedData {
 	te := newTest(t, tc)
-	te.startServer(testpb.NewTestServiceService(&testServer{te: te}))
+	te.startServer((&testServer{te: te}).Svc())
 	defer te.tearDown()
 
 	expect := &expectedData{
diff --git a/interop/grpc_testing/test_grpc.pb.go b/interop/grpc_testing/test_grpc.pb.go
index 9496348..e158bb4 100644
--- a/interop/grpc_testing/test_grpc.pb.go
+++ b/interop/grpc_testing/test_grpc.pb.go
@@ -455,74 +455,6 @@
 	s.RegisterService(&sd, nil)
 }
 
-// NewTestServiceService creates a new TestServiceService containing the
-// implemented methods of the TestService service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewTestServiceService(s interface{}) *TestServiceService {
-	ns := &TestServiceService{}
-	if h, ok := s.(interface {
-		EmptyCall(context.Context, *Empty) (*Empty, error)
-	}); ok {
-		ns.EmptyCall = h.EmptyCall
-	}
-	if h, ok := s.(interface {
-		UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error)
-	}); ok {
-		ns.UnaryCall = h.UnaryCall
-	}
-	if h, ok := s.(interface {
-		StreamingOutputCall(*StreamingOutputCallRequest, TestService_StreamingOutputCallServer) error
-	}); ok {
-		ns.StreamingOutputCall = h.StreamingOutputCall
-	}
-	if h, ok := s.(interface {
-		StreamingInputCall(TestService_StreamingInputCallServer) error
-	}); ok {
-		ns.StreamingInputCall = h.StreamingInputCall
-	}
-	if h, ok := s.(interface {
-		FullDuplexCall(TestService_FullDuplexCallServer) error
-	}); ok {
-		ns.FullDuplexCall = h.FullDuplexCall
-	}
-	if h, ok := s.(interface {
-		HalfDuplexCall(TestService_HalfDuplexCallServer) error
-	}); ok {
-		ns.HalfDuplexCall = h.HalfDuplexCall
-	}
-	return ns
-}
-
-// UnstableTestServiceService is the service API for TestService service.
-// New methods may be added to this interface if they are added to the service
-// definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableTestServiceService interface {
-	// One empty request followed by one empty response.
-	EmptyCall(context.Context, *Empty) (*Empty, error)
-	// One request followed by one response.
-	// The server returns the client payload as-is.
-	UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error)
-	// One request followed by a sequence of responses (streamed download).
-	// The server returns the payload with client desired type and sizes.
-	StreamingOutputCall(*StreamingOutputCallRequest, TestService_StreamingOutputCallServer) error
-	// A sequence of requests followed by one response (streamed upload).
-	// The server returns the aggregated size of client payload as the result.
-	StreamingInputCall(TestService_StreamingInputCallServer) error
-	// A sequence of requests with each request served by the server immediately.
-	// As one request could lead to multiple responses, this interface
-	// demonstrates the idea of full duplexing.
-	FullDuplexCall(TestService_FullDuplexCallServer) error
-	// A sequence of requests followed by a sequence of responses.
-	// The server buffers all the client requests and then serves them in order. A
-	// stream of responses are returned to the client when the server starts with
-	// first request.
-	HalfDuplexCall(TestService_HalfDuplexCallServer) error
-}
-
 // UnimplementedServiceClient is the client API for UnimplementedService service.
 //
 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
@@ -602,31 +534,6 @@
 	s.RegisterService(&sd, nil)
 }
 
-// NewUnimplementedServiceService creates a new UnimplementedServiceService containing the
-// implemented methods of the UnimplementedService service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewUnimplementedServiceService(s interface{}) *UnimplementedServiceService {
-	ns := &UnimplementedServiceService{}
-	if h, ok := s.(interface {
-		UnimplementedCall(context.Context, *Empty) (*Empty, error)
-	}); ok {
-		ns.UnimplementedCall = h.UnimplementedCall
-	}
-	return ns
-}
-
-// UnstableUnimplementedServiceService is the service API for UnimplementedService service.
-// New methods may be added to this interface if they are added to the service
-// definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableUnimplementedServiceService interface {
-	// A call that no server should implement
-	UnimplementedCall(context.Context, *Empty) (*Empty, error)
-}
-
 // LoadBalancerStatsServiceClient is the client API for LoadBalancerStatsService service.
 //
 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
@@ -705,28 +612,3 @@
 
 	s.RegisterService(&sd, nil)
 }
-
-// NewLoadBalancerStatsServiceService creates a new LoadBalancerStatsServiceService containing the
-// implemented methods of the LoadBalancerStatsService service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewLoadBalancerStatsServiceService(s interface{}) *LoadBalancerStatsServiceService {
-	ns := &LoadBalancerStatsServiceService{}
-	if h, ok := s.(interface {
-		GetClientStats(context.Context, *LoadBalancerStatsRequest) (*LoadBalancerStatsResponse, error)
-	}); ok {
-		ns.GetClientStats = h.GetClientStats
-	}
-	return ns
-}
-
-// UnstableLoadBalancerStatsServiceService is the service API for LoadBalancerStatsService service.
-// New methods may be added to this interface if they are added to the service
-// definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableLoadBalancerStatsServiceService interface {
-	// Gets the backend distribution for RPCs sent by a test client.
-	GetClientStats(context.Context, *LoadBalancerStatsRequest) (*LoadBalancerStatsResponse, error)
-}
diff --git a/interop/test_utils.go b/interop/test_utils.go
index 7a42116..dd2a731 100644
--- a/interop/test_utils.go
+++ b/interop/test_utils.go
@@ -677,7 +677,15 @@
 
 // NewTestServer creates a test server for test service.
 func NewTestServer() *testpb.TestServiceService {
-	return testpb.NewTestServiceService(testpb.UnstableTestServiceService(&testServer{}))
+	s := testServer{}
+	return &testpb.TestServiceService{
+		EmptyCall:           s.EmptyCall,
+		UnaryCall:           s.UnaryCall,
+		StreamingOutputCall: s.StreamingOutputCall,
+		StreamingInputCall:  s.StreamingInputCall,
+		FullDuplexCall:      s.FullDuplexCall,
+		HalfDuplexCall:      s.HalfDuplexCall,
+	}
 }
 
 func (s *testServer) EmptyCall(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) {
diff --git a/profiling/proto/service.pb.go b/profiling/proto/service.pb.go
index 90f0282..831a627 100644
--- a/profiling/proto/service.pb.go
+++ b/profiling/proto/service.pb.go
@@ -4,12 +4,8 @@
 package proto
 
 import (
-	context "context"
 	fmt "fmt"
 	proto "github.com/golang/protobuf/proto"
-	grpc "google.golang.org/grpc"
-	codes "google.golang.org/grpc/codes"
-	status "google.golang.org/grpc/status"
 	math "math"
 )
 
@@ -366,125 +362,3 @@
 	0x95, 0xbb, 0x2e, 0xf9, 0xc9, 0xfd, 0xaf, 0x42, 0xfa, 0xbc, 0xf9, 0x13, 0x00, 0x00, 0xff, 0xff,
 	0x5d, 0x47, 0x09, 0xa9, 0x19, 0x03, 0x00, 0x00,
 }
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConnInterface
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion6
-
-// ProfilingClient is the client API for Profiling service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type ProfilingClient interface {
-	// Enable allows users to toggle profiling on and off remotely.
-	Enable(ctx context.Context, in *EnableRequest, opts ...grpc.CallOption) (*EnableResponse, error)
-	// GetStreamStats is used to retrieve an array of stream-level stats from a
-	// gRPC client/server.
-	GetStreamStats(ctx context.Context, in *GetStreamStatsRequest, opts ...grpc.CallOption) (*GetStreamStatsResponse, error)
-}
-
-type profilingClient struct {
-	cc grpc.ClientConnInterface
-}
-
-func NewProfilingClient(cc grpc.ClientConnInterface) ProfilingClient {
-	return &profilingClient{cc}
-}
-
-func (c *profilingClient) Enable(ctx context.Context, in *EnableRequest, opts ...grpc.CallOption) (*EnableResponse, error) {
-	out := new(EnableResponse)
-	err := c.cc.Invoke(ctx, "/grpc.go.profiling.v1alpha.Profiling/Enable", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *profilingClient) GetStreamStats(ctx context.Context, in *GetStreamStatsRequest, opts ...grpc.CallOption) (*GetStreamStatsResponse, error) {
-	out := new(GetStreamStatsResponse)
-	err := c.cc.Invoke(ctx, "/grpc.go.profiling.v1alpha.Profiling/GetStreamStats", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-// ProfilingServer is the server API for Profiling service.
-type ProfilingServer interface {
-	// Enable allows users to toggle profiling on and off remotely.
-	Enable(context.Context, *EnableRequest) (*EnableResponse, error)
-	// GetStreamStats is used to retrieve an array of stream-level stats from a
-	// gRPC client/server.
-	GetStreamStats(context.Context, *GetStreamStatsRequest) (*GetStreamStatsResponse, error)
-}
-
-// UnimplementedProfilingServer can be embedded to have forward compatible implementations.
-type UnimplementedProfilingServer struct {
-}
-
-func (*UnimplementedProfilingServer) Enable(ctx context.Context, req *EnableRequest) (*EnableResponse, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method Enable not implemented")
-}
-func (*UnimplementedProfilingServer) GetStreamStats(ctx context.Context, req *GetStreamStatsRequest) (*GetStreamStatsResponse, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method GetStreamStats not implemented")
-}
-
-func RegisterProfilingServer(s *grpc.Server, srv ProfilingServer) {
-	s.RegisterService(&_Profiling_serviceDesc, srv)
-}
-
-func _Profiling_Enable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(EnableRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ProfilingServer).Enable(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/grpc.go.profiling.v1alpha.Profiling/Enable",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ProfilingServer).Enable(ctx, req.(*EnableRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Profiling_GetStreamStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(GetStreamStatsRequest)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ProfilingServer).GetStreamStats(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/grpc.go.profiling.v1alpha.Profiling/GetStreamStats",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ProfilingServer).GetStreamStats(ctx, req.(*GetStreamStatsRequest))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-var _Profiling_serviceDesc = grpc.ServiceDesc{
-	ServiceName: "grpc.go.profiling.v1alpha.Profiling",
-	HandlerType: (*ProfilingServer)(nil),
-	Methods: []grpc.MethodDesc{
-		{
-			MethodName: "Enable",
-			Handler:    _Profiling_Enable_Handler,
-		},
-		{
-			MethodName: "GetStreamStats",
-			Handler:    _Profiling_GetStreamStats_Handler,
-		},
-	},
-	Streams:  []grpc.StreamDesc{},
-	Metadata: "profiling/proto/service.proto",
-}
diff --git a/profiling/proto/service_grpc.pb.go b/profiling/proto/service_grpc.pb.go
index 4145087..02783c9 100644
--- a/profiling/proto/service_grpc.pb.go
+++ b/profiling/proto/service_grpc.pb.go
@@ -13,6 +13,51 @@
 // is compatible with the grpc package it is being compiled against.
 const _ = grpc.SupportPackageIsVersion7
 
+// ProfilingClient is the client API for Profiling service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type ProfilingClient interface {
+	// Enable allows users to toggle profiling on and off remotely.
+	Enable(ctx context.Context, in *EnableRequest, opts ...grpc.CallOption) (*EnableResponse, error)
+	// GetStreamStats is used to retrieve an array of stream-level stats from a
+	// gRPC client/server.
+	GetStreamStats(ctx context.Context, in *GetStreamStatsRequest, opts ...grpc.CallOption) (*GetStreamStatsResponse, error)
+}
+
+type profilingClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewProfilingClient(cc grpc.ClientConnInterface) ProfilingClient {
+	return &profilingClient{cc}
+}
+
+var profilingEnableStreamDesc = &grpc.StreamDesc{
+	StreamName: "Enable",
+}
+
+func (c *profilingClient) Enable(ctx context.Context, in *EnableRequest, opts ...grpc.CallOption) (*EnableResponse, error) {
+	out := new(EnableResponse)
+	err := c.cc.Invoke(ctx, "/grpc.go.profiling.v1alpha.Profiling/Enable", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+var profilingGetStreamStatsStreamDesc = &grpc.StreamDesc{
+	StreamName: "GetStreamStats",
+}
+
+func (c *profilingClient) GetStreamStats(ctx context.Context, in *GetStreamStatsRequest, opts ...grpc.CallOption) (*GetStreamStatsResponse, error) {
+	out := new(GetStreamStatsResponse)
+	err := c.cc.Invoke(ctx, "/grpc.go.profiling.v1alpha.Profiling/GetStreamStats", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // ProfilingService is the service API for Profiling service.
 // Fields should be assigned to their respective handler implementations only before
 // RegisterProfilingService is called.  Any unassigned fields will result in the
@@ -92,35 +137,35 @@
 	s.RegisterService(&sd, nil)
 }
 
-// NewProfilingService creates a new ProfilingService containing the
-// implemented methods of the Profiling service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewProfilingService(s interface{}) *ProfilingService {
-	ns := &ProfilingService{}
-	if h, ok := s.(interface {
-		Enable(context.Context, *EnableRequest) (*EnableResponse, error)
-	}); ok {
-		ns.Enable = h.Enable
-	}
-	if h, ok := s.(interface {
-		GetStreamStats(context.Context, *GetStreamStatsRequest) (*GetStreamStatsResponse, error)
-	}); ok {
-		ns.GetStreamStats = h.GetStreamStats
-	}
-	return ns
-}
-
-// UnstableProfilingService is the service API for Profiling service.
+// ProfilingServer is the service API for Profiling service.
 // New methods may be added to this interface if they are added to the service
 // definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableProfilingService interface {
+// use of this type is not recommended unless you own the service definition.
+type ProfilingServer interface {
 	// Enable allows users to toggle profiling on and off remotely.
 	Enable(context.Context, *EnableRequest) (*EnableResponse, error)
 	// GetStreamStats is used to retrieve an array of stream-level stats from a
 	// gRPC client/server.
 	GetStreamStats(context.Context, *GetStreamStatsRequest) (*GetStreamStatsResponse, error)
 }
+
+// UnimplementedProfilingServer can be embedded to have forward compatible implementations of
+// ProfilingServer
+type UnimplementedProfilingServer struct {
+}
+
+func (*UnimplementedProfilingServer) Enable(context.Context, *EnableRequest) (*EnableResponse, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method Enable not implemented")
+}
+func (*UnimplementedProfilingServer) GetStreamStats(context.Context, *GetStreamStatsRequest) (*GetStreamStatsResponse, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetStreamStats not implemented")
+}
+
+// RegisterProfilingServer registers a service implementation with a gRPC server.
+func RegisterProfilingServer(s grpc.ServiceRegistrar, srv ProfilingServer) {
+	str := &ProfilingService{
+		Enable:         srv.Enable,
+		GetStreamStats: srv.GetStreamStats,
+	}
+	RegisterProfilingService(s, str)
+}
diff --git a/reflection/grpc_reflection_v1alpha/reflection.pb.go b/reflection/grpc_reflection_v1alpha/reflection.pb.go
index 900bd6c..382612d 100644
--- a/reflection/grpc_reflection_v1alpha/reflection.pb.go
+++ b/reflection/grpc_reflection_v1alpha/reflection.pb.go
@@ -4,12 +4,8 @@
 package grpc_reflection_v1alpha
 
 import (
-	context "context"
 	fmt "fmt"
 	proto "github.com/golang/protobuf/proto"
-	grpc "google.golang.org/grpc"
-	codes "google.golang.org/grpc/codes"
-	status "google.golang.org/grpc/status"
 	math "math"
 )
 
@@ -636,119 +632,3 @@
 	0xcb, 0xb3, 0xdb, 0x8c, 0xdb, 0xea, 0x53, 0xd5, 0xb9, 0xfd, 0xd3, 0x35, 0xdc, 0x54, 0xbe, 0x39,
 	0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x6c, 0x74, 0x3a, 0x67, 0xe7, 0x06, 0x00, 0x00,
 }
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConnInterface
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion6
-
-// ServerReflectionClient is the client API for ServerReflection service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type ServerReflectionClient interface {
-	// The reflection service is structured as a bidirectional stream, ensuring
-	// all related requests go to a single server.
-	ServerReflectionInfo(ctx context.Context, opts ...grpc.CallOption) (ServerReflection_ServerReflectionInfoClient, error)
-}
-
-type serverReflectionClient struct {
-	cc grpc.ClientConnInterface
-}
-
-func NewServerReflectionClient(cc grpc.ClientConnInterface) ServerReflectionClient {
-	return &serverReflectionClient{cc}
-}
-
-func (c *serverReflectionClient) ServerReflectionInfo(ctx context.Context, opts ...grpc.CallOption) (ServerReflection_ServerReflectionInfoClient, error) {
-	stream, err := c.cc.NewStream(ctx, &_ServerReflection_serviceDesc.Streams[0], "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo", opts...)
-	if err != nil {
-		return nil, err
-	}
-	x := &serverReflectionServerReflectionInfoClient{stream}
-	return x, nil
-}
-
-type ServerReflection_ServerReflectionInfoClient interface {
-	Send(*ServerReflectionRequest) error
-	Recv() (*ServerReflectionResponse, error)
-	grpc.ClientStream
-}
-
-type serverReflectionServerReflectionInfoClient struct {
-	grpc.ClientStream
-}
-
-func (x *serverReflectionServerReflectionInfoClient) Send(m *ServerReflectionRequest) error {
-	return x.ClientStream.SendMsg(m)
-}
-
-func (x *serverReflectionServerReflectionInfoClient) Recv() (*ServerReflectionResponse, error) {
-	m := new(ServerReflectionResponse)
-	if err := x.ClientStream.RecvMsg(m); err != nil {
-		return nil, err
-	}
-	return m, nil
-}
-
-// ServerReflectionServer is the server API for ServerReflection service.
-type ServerReflectionServer interface {
-	// The reflection service is structured as a bidirectional stream, ensuring
-	// all related requests go to a single server.
-	ServerReflectionInfo(ServerReflection_ServerReflectionInfoServer) error
-}
-
-// UnimplementedServerReflectionServer can be embedded to have forward compatible implementations.
-type UnimplementedServerReflectionServer struct {
-}
-
-func (*UnimplementedServerReflectionServer) ServerReflectionInfo(srv ServerReflection_ServerReflectionInfoServer) error {
-	return status.Errorf(codes.Unimplemented, "method ServerReflectionInfo not implemented")
-}
-
-func RegisterServerReflectionServer(s *grpc.Server, srv ServerReflectionServer) {
-	s.RegisterService(&_ServerReflection_serviceDesc, srv)
-}
-
-func _ServerReflection_ServerReflectionInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
-	return srv.(ServerReflectionServer).ServerReflectionInfo(&serverReflectionServerReflectionInfoServer{stream})
-}
-
-type ServerReflection_ServerReflectionInfoServer interface {
-	Send(*ServerReflectionResponse) error
-	Recv() (*ServerReflectionRequest, error)
-	grpc.ServerStream
-}
-
-type serverReflectionServerReflectionInfoServer struct {
-	grpc.ServerStream
-}
-
-func (x *serverReflectionServerReflectionInfoServer) Send(m *ServerReflectionResponse) error {
-	return x.ServerStream.SendMsg(m)
-}
-
-func (x *serverReflectionServerReflectionInfoServer) Recv() (*ServerReflectionRequest, error) {
-	m := new(ServerReflectionRequest)
-	if err := x.ServerStream.RecvMsg(m); err != nil {
-		return nil, err
-	}
-	return m, nil
-}
-
-var _ServerReflection_serviceDesc = grpc.ServiceDesc{
-	ServiceName: "grpc.reflection.v1alpha.ServerReflection",
-	HandlerType: (*ServerReflectionServer)(nil),
-	Methods:     []grpc.MethodDesc{},
-	Streams: []grpc.StreamDesc{
-		{
-			StreamName:    "ServerReflectionInfo",
-			Handler:       _ServerReflection_ServerReflectionInfo_Handler,
-			ServerStreams: true,
-			ClientStreams: true,
-		},
-	},
-	Metadata: "reflection/grpc_reflection_v1alpha/reflection.proto",
-}
diff --git a/reflection/grpc_reflection_v1alpha/reflection_grpc.pb.go b/reflection/grpc_reflection_v1alpha/reflection_grpc.pb.go
index 5524152..eface9e 100644
--- a/reflection/grpc_reflection_v1alpha/reflection_grpc.pb.go
+++ b/reflection/grpc_reflection_v1alpha/reflection_grpc.pb.go
@@ -3,6 +3,7 @@
 package grpc_reflection_v1alpha
 
 import (
+	context "context"
 	grpc "google.golang.org/grpc"
 	codes "google.golang.org/grpc/codes"
 	status "google.golang.org/grpc/status"
@@ -12,6 +13,60 @@
 // is compatible with the grpc package it is being compiled against.
 const _ = grpc.SupportPackageIsVersion7
 
+// ServerReflectionClient is the client API for ServerReflection service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type ServerReflectionClient interface {
+	// The reflection service is structured as a bidirectional stream, ensuring
+	// all related requests go to a single server.
+	ServerReflectionInfo(ctx context.Context, opts ...grpc.CallOption) (ServerReflection_ServerReflectionInfoClient, error)
+}
+
+type serverReflectionClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewServerReflectionClient(cc grpc.ClientConnInterface) ServerReflectionClient {
+	return &serverReflectionClient{cc}
+}
+
+var serverReflectionServerReflectionInfoStreamDesc = &grpc.StreamDesc{
+	StreamName:    "ServerReflectionInfo",
+	ServerStreams: true,
+	ClientStreams: true,
+}
+
+func (c *serverReflectionClient) ServerReflectionInfo(ctx context.Context, opts ...grpc.CallOption) (ServerReflection_ServerReflectionInfoClient, error) {
+	stream, err := c.cc.NewStream(ctx, serverReflectionServerReflectionInfoStreamDesc, "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo", opts...)
+	if err != nil {
+		return nil, err
+	}
+	x := &serverReflectionServerReflectionInfoClient{stream}
+	return x, nil
+}
+
+type ServerReflection_ServerReflectionInfoClient interface {
+	Send(*ServerReflectionRequest) error
+	Recv() (*ServerReflectionResponse, error)
+	grpc.ClientStream
+}
+
+type serverReflectionServerReflectionInfoClient struct {
+	grpc.ClientStream
+}
+
+func (x *serverReflectionServerReflectionInfoClient) Send(m *ServerReflectionRequest) error {
+	return x.ClientStream.SendMsg(m)
+}
+
+func (x *serverReflectionServerReflectionInfoClient) Recv() (*ServerReflectionResponse, error) {
+	m := new(ServerReflectionResponse)
+	if err := x.ClientStream.RecvMsg(m); err != nil {
+		return nil, err
+	}
+	return m, nil
+}
+
 // ServerReflectionService is the service API for ServerReflection service.
 // Fields should be assigned to their respective handler implementations only before
 // RegisterServerReflectionService is called.  Any unassigned fields will result in the
@@ -26,6 +81,28 @@
 	return s.ServerReflectionInfo(&serverReflectionServerReflectionInfoServer{stream})
 }
 
+type ServerReflection_ServerReflectionInfoServer interface {
+	Send(*ServerReflectionResponse) error
+	Recv() (*ServerReflectionRequest, error)
+	grpc.ServerStream
+}
+
+type serverReflectionServerReflectionInfoServer struct {
+	grpc.ServerStream
+}
+
+func (x *serverReflectionServerReflectionInfoServer) Send(m *ServerReflectionResponse) error {
+	return x.ServerStream.SendMsg(m)
+}
+
+func (x *serverReflectionServerReflectionInfoServer) Recv() (*ServerReflectionRequest, error) {
+	m := new(ServerReflectionRequest)
+	if err := x.ServerStream.RecvMsg(m); err != nil {
+		return nil, err
+	}
+	return m, nil
+}
+
 // RegisterServerReflectionService registers a service implementation with a gRPC server.
 func RegisterServerReflectionService(s grpc.ServiceRegistrar, srv *ServerReflectionService) {
 	srvCopy := *srv
@@ -51,28 +128,29 @@
 	s.RegisterService(&sd, nil)
 }
 
-// NewServerReflectionService creates a new ServerReflectionService containing the
-// implemented methods of the ServerReflection service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewServerReflectionService(s interface{}) *ServerReflectionService {
-	ns := &ServerReflectionService{}
-	if h, ok := s.(interface {
-		ServerReflectionInfo(ServerReflection_ServerReflectionInfoServer) error
-	}); ok {
-		ns.ServerReflectionInfo = h.ServerReflectionInfo
-	}
-	return ns
-}
-
-// UnstableServerReflectionService is the service API for ServerReflection service.
+// ServerReflectionServer is the service API for ServerReflection service.
 // New methods may be added to this interface if they are added to the service
 // definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableServerReflectionService interface {
+// use of this type is not recommended unless you own the service definition.
+type ServerReflectionServer interface {
 	// The reflection service is structured as a bidirectional stream, ensuring
 	// all related requests go to a single server.
 	ServerReflectionInfo(ServerReflection_ServerReflectionInfoServer) error
 }
+
+// UnimplementedServerReflectionServer can be embedded to have forward compatible implementations of
+// ServerReflectionServer
+type UnimplementedServerReflectionServer struct {
+}
+
+func (*UnimplementedServerReflectionServer) ServerReflectionInfo(ServerReflection_ServerReflectionInfoServer) error {
+	return status.Errorf(codes.Unimplemented, "method ServerReflectionInfo not implemented")
+}
+
+// RegisterServerReflectionServer registers a service implementation with a gRPC server.
+func RegisterServerReflectionServer(s grpc.ServiceRegistrar, srv ServerReflectionServer) {
+	str := &ServerReflectionService{
+		ServerReflectionInfo: srv.ServerReflectionInfo,
+	}
+	RegisterServerReflectionService(s, str)
+}
diff --git a/reflection/grpc_testing/test_grpc.pb.go b/reflection/grpc_testing/test_grpc.pb.go
index 2749e16..503c856 100644
--- a/reflection/grpc_testing/test_grpc.pb.go
+++ b/reflection/grpc_testing/test_grpc.pb.go
@@ -165,33 +165,3 @@
 
 	s.RegisterService(&sd, nil)
 }
-
-// NewSearchServiceService creates a new SearchServiceService containing the
-// implemented methods of the SearchService service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewSearchServiceService(s interface{}) *SearchServiceService {
-	ns := &SearchServiceService{}
-	if h, ok := s.(interface {
-		Search(context.Context, *SearchRequest) (*SearchResponse, error)
-	}); ok {
-		ns.Search = h.Search
-	}
-	if h, ok := s.(interface {
-		StreamingSearch(SearchService_StreamingSearchServer) error
-	}); ok {
-		ns.StreamingSearch = h.StreamingSearch
-	}
-	return ns
-}
-
-// UnstableSearchServiceService is the service API for SearchService service.
-// New methods may be added to this interface if they are added to the service
-// definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableSearchServiceService interface {
-	Search(context.Context, *SearchRequest) (*SearchResponse, error)
-	StreamingSearch(SearchService_StreamingSearchServer) error
-}
diff --git a/reflection/serverreflection_test.go b/reflection/serverreflection_test.go
index 9f252d7..95b8269 100644
--- a/reflection/serverreflection_test.go
+++ b/reflection/serverreflection_test.go
@@ -168,7 +168,12 @@
 
 type server struct{}
 
-var _ pb.UnstableSearchServiceService = (*server)(nil)
+func (s *server) Svc() *pb.SearchServiceService {
+	return &pb.SearchServiceService{
+		Search:          s.Search,
+		StreamingSearch: s.StreamingSearch,
+	}
+}
 
 func (s *server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.SearchResponse, error) {
 	return &pb.SearchResponse{}, nil
@@ -195,7 +200,7 @@
 		t.Fatalf("failed to listen: %v", err)
 	}
 	s := grpc.NewServer()
-	pb.RegisterSearchServiceService(s, pb.NewSearchServiceService(&server{}))
+	pb.RegisterSearchServiceService(s, (&server{}).Svc())
 	pbv3.RegisterSearchServiceV3Server(s, &serverV3{})
 	// Register reflection service on s.
 	Register(s)
diff --git a/regenerate.sh b/regenerate.sh
index 750e350..c10bc99 100755
--- a/regenerate.sh
+++ b/regenerate.sh
@@ -96,7 +96,7 @@
 
 for src in ${LEGACY_SOURCES[@]}; do
   echo "protoc ${src}"
-  protoc --go_out=${OPTS},plugins=grpc:${WORKDIR}/out --go-grpc_out=${OPTS},migration_mode=true:${WORKDIR}/out \
+  protoc --go_out=${OPTS}:${WORKDIR}/out --go-grpc_out=${OPTS},gen_unstable_server_interfaces=true:${WORKDIR}/out \
     -I"." \
     -I${WORKDIR}/grpc-proto \
     -I${WORKDIR}/googleapis \
diff --git a/security/advancedtls/advancedtls_integration_test.go b/security/advancedtls/advancedtls_integration_test.go
index a794e0d..dc4f513 100644
--- a/security/advancedtls/advancedtls_integration_test.go
+++ b/security/advancedtls/advancedtls_integration_test.go
@@ -130,11 +130,8 @@
 	return nil
 }
 
-// serverImpl is used to implement pb.GreeterServer.
-type serverImpl struct{}
-
-// SayHello is a simple implementation of pb.GreeterServer.
-func (s *serverImpl) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) {
+// sayHello is a simple implementation of the pb.GreeterServer SayHello method.
+func sayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) {
 	return &pb.HelloReply{Message: "Hello " + in.Name}, nil
 }
 
@@ -409,7 +406,7 @@
 				t.Fatalf("failed to listen: %v", err)
 			}
 			defer lis.Close()
-			pb.RegisterGreeterService(s, pb.NewGreeterService(&serverImpl{}))
+			pb.RegisterGreeterService(s, &pb.GreeterService{SayHello: sayHello})
 			go s.Serve(lis)
 			clientOptions := &ClientOptions{
 				Certificates:         test.clientCert,
diff --git a/stats/grpc_testing/test_grpc.pb.go b/stats/grpc_testing/test_grpc.pb.go
index c131efe..32f93dd 100644
--- a/stats/grpc_testing/test_grpc.pb.go
+++ b/stats/grpc_testing/test_grpc.pb.go
@@ -324,52 +324,3 @@
 
 	s.RegisterService(&sd, nil)
 }
-
-// NewTestServiceService creates a new TestServiceService containing the
-// implemented methods of the TestService service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewTestServiceService(s interface{}) *TestServiceService {
-	ns := &TestServiceService{}
-	if h, ok := s.(interface {
-		UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error)
-	}); ok {
-		ns.UnaryCall = h.UnaryCall
-	}
-	if h, ok := s.(interface {
-		FullDuplexCall(TestService_FullDuplexCallServer) error
-	}); ok {
-		ns.FullDuplexCall = h.FullDuplexCall
-	}
-	if h, ok := s.(interface {
-		ClientStreamCall(TestService_ClientStreamCallServer) error
-	}); ok {
-		ns.ClientStreamCall = h.ClientStreamCall
-	}
-	if h, ok := s.(interface {
-		ServerStreamCall(*SimpleRequest, TestService_ServerStreamCallServer) error
-	}); ok {
-		ns.ServerStreamCall = h.ServerStreamCall
-	}
-	return ns
-}
-
-// UnstableTestServiceService is the service API for TestService service.
-// New methods may be added to this interface if they are added to the service
-// definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableTestServiceService interface {
-	// One request followed by one response.
-	// The server returns the client id as-is.
-	UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error)
-	// A sequence of requests with each request served by the server immediately.
-	// As one request could lead to multiple responses, this interface
-	// demonstrates the idea of full duplexing.
-	FullDuplexCall(TestService_FullDuplexCallServer) error
-	// Client stream
-	ClientStreamCall(TestService_ClientStreamCallServer) error
-	// Server stream
-	ServerStreamCall(*SimpleRequest, TestService_ServerStreamCallServer) error
-}
diff --git a/stats/stats_test.go b/stats/stats_test.go
index 628533e..90b9cdb 100644
--- a/stats/stats_test.go
+++ b/stats/stats_test.go
@@ -75,7 +75,14 @@
 
 type testServer struct{}
 
-var _ testpb.UnstableTestServiceService = (*testServer)(nil)
+func (s *testServer) Svc() *testpb.TestServiceService {
+	return &testpb.TestServiceService{
+		UnaryCall:        s.UnaryCall,
+		FullDuplexCall:   s.FullDuplexCall,
+		ClientStreamCall: s.ClientStreamCall,
+		ServerStreamCall: s.ServerStreamCall,
+	}
+}
 
 func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
 	if err := grpc.SendHeader(ctx, testHeaderMetadata); err != nil {
@@ -815,7 +822,7 @@
 func testServerStats(t *testing.T, tc *testConfig, cc *rpcConfig, checkFuncs []func(t *testing.T, d *gotData, e *expectedData)) {
 	h := &statshandler{}
 	te := newTest(t, tc, nil, h)
-	te.startServer(testpb.NewTestServiceService(&testServer{}))
+	te.startServer((&testServer{}).Svc())
 	defer te.tearDown()
 
 	var (
@@ -1106,7 +1113,7 @@
 func testClientStats(t *testing.T, tc *testConfig, cc *rpcConfig, checkFuncs map[int]*checkFuncWithCount) {
 	h := &statshandler{}
 	te := newTest(t, tc, h, nil)
-	te.startServer(testpb.NewTestServiceService(&testServer{}))
+	te.startServer((&testServer{}).Svc())
 	defer te.tearDown()
 
 	var (
diff --git a/stress/client/main.go b/stress/client/main.go
index 0353476..c91aeb0 100644
--- a/stress/client/main.go
+++ b/stress/client/main.go
@@ -151,13 +151,18 @@
 	gauges map[string]*gauge
 }
 
-var _ metricspb.UnstableMetricsServiceService = (*server)(nil)
-
 // newMetricsServer returns a new metrics server.
 func newMetricsServer() *server {
 	return &server{gauges: make(map[string]*gauge)}
 }
 
+func (s *server) Svc() *metricspb.MetricsServiceService {
+	return &metricspb.MetricsServiceService{
+		GetAllGauges: s.GetAllGauges,
+		GetGauge:     s.GetGauge,
+	}
+}
+
 // GetAllGauges returns all gauges.
 func (s *server) GetAllGauges(in *metricspb.EmptyMessage, stream metricspb.MetricsService_GetAllGaugesServer) error {
 	s.mutex.RLock()
@@ -203,9 +208,8 @@
 	}
 
 	s := grpc.NewServer()
-	metricspb.RegisterMetricsServiceService(s, metricspb.NewMetricsServiceService(server))
+	metricspb.RegisterMetricsServiceService(s, server.Svc())
 	s.Serve(lis)
-
 }
 
 // performRPCs uses weightedRandomTestSelector to select test case and runs the tests.
diff --git a/stress/grpc_testing/metrics_grpc.pb.go b/stress/grpc_testing/metrics_grpc.pb.go
index 6ae1c80..b28a52e 100644
--- a/stress/grpc_testing/metrics_grpc.pb.go
+++ b/stress/grpc_testing/metrics_grpc.pb.go
@@ -165,36 +165,3 @@
 
 	s.RegisterService(&sd, nil)
 }
-
-// NewMetricsServiceService creates a new MetricsServiceService containing the
-// implemented methods of the MetricsService service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewMetricsServiceService(s interface{}) *MetricsServiceService {
-	ns := &MetricsServiceService{}
-	if h, ok := s.(interface {
-		GetAllGauges(*EmptyMessage, MetricsService_GetAllGaugesServer) error
-	}); ok {
-		ns.GetAllGauges = h.GetAllGauges
-	}
-	if h, ok := s.(interface {
-		GetGauge(context.Context, *GaugeRequest) (*GaugeResponse, error)
-	}); ok {
-		ns.GetGauge = h.GetGauge
-	}
-	return ns
-}
-
-// UnstableMetricsServiceService is the service API for MetricsService service.
-// New methods may be added to this interface if they are added to the service
-// definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableMetricsServiceService interface {
-	// Returns the values of all the gauges that are currently being maintained by
-	// the service
-	GetAllGauges(*EmptyMessage, MetricsService_GetAllGaugesServer) error
-	// Returns the value of one gauge
-	GetGauge(context.Context, *GaugeRequest) (*GaugeResponse, error)
-}
diff --git a/test/balancer_test.go b/test/balancer_test.go
index a94e25a..43e5021 100644
--- a/test/balancer_test.go
+++ b/test/balancer_test.go
@@ -179,7 +179,7 @@
 		grpc.WithBalancerName(testBalancerName),
 		grpc.WithUserAgent(testUserAgent),
 	}
-	te.startServer((&testServer{security: e.security}).Svc())
+	te.startServer(testServer{security: e.security}.Svc())
 	defer te.tearDown()
 
 	// Set resolver to xds to trigger the extra metadata code path.
@@ -228,7 +228,7 @@
 		grpc.WithBalancerName(testBalancerName),
 	}
 	te.userAgent = failAppUA
-	te.startServer((&testServer{security: e.security}).Svc())
+	te.startServer(testServer{security: e.security}.Svc())
 	defer te.tearDown()
 
 	cc := te.clientConn()
@@ -498,7 +498,7 @@
 	}
 
 	s := grpc.NewServer()
-	testpb.RegisterTestServiceService(s, testServer{}.Svc())
+	testpb.RegisterTestServiceService(s, (&testServer{}).Svc())
 	go s.Serve(lis)
 	defer s.Stop()
 	t.Logf("Started gRPC server at %s...", lis.Addr().String())
diff --git a/test/end2end_test.go b/test/end2end_test.go
index b0fa10b..01f99cb 100644
--- a/test/end2end_test.go
+++ b/test/end2end_test.go
@@ -134,8 +134,6 @@
 	unaryCallSleepTime time.Duration
 }
 
-var _ testpb.UnstableTestServiceService = (*testServer)(nil)
-
 // Svc returns a registerable TestService for this testServer instances.
 // Because `s` is passed by value for convenience, any subsequent changes to
 // `s` are not recognized.
@@ -4859,10 +4857,10 @@
 	defer lis.Close()
 
 	s := grpc.NewServer()
-	testpb.RegisterTestServiceService(s, testpb.NewTestServiceService(&flowControlLogicalRaceServer{
+	testpb.RegisterTestServiceService(s, (&flowControlLogicalRaceServer{
 		itemCount: itemCount,
 		itemSize:  itemSize,
-	}))
+	}).Svc())
 	defer s.Stop()
 
 	go s.Serve(lis)
@@ -4920,6 +4918,12 @@
 	itemCount int
 }
 
+func (s *flowControlLogicalRaceServer) Svc() *testpb.TestServiceService {
+	return &testpb.TestServiceService{
+		StreamingOutputCall: s.StreamingOutputCall,
+	}
+}
+
 func (s *flowControlLogicalRaceServer) StreamingOutputCall(req *testpb.StreamingOutputCallRequest, srv testpb.TestService_StreamingOutputCallServer) error {
 	for i := 0; i < s.itemCount; i++ {
 		err := srv.Send(&testpb.StreamingOutputCallResponse{
@@ -5083,16 +5087,12 @@
 	r *manual.Resolver
 }
 
-func (ss *stubServer) EmptyCall(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) {
-	return ss.emptyCall(ctx, in)
-}
-
-func (ss *stubServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
-	return ss.unaryCall(ctx, in)
-}
-
-func (ss *stubServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error {
-	return ss.fullDuplexCall(stream)
+func (ss *stubServer) Svc() *testpb.TestServiceService {
+	return &testpb.TestServiceService{
+		EmptyCall:      ss.emptyCall,
+		UnaryCall:      ss.unaryCall,
+		FullDuplexCall: ss.fullDuplexCall,
+	}
 }
 
 // Start starts the server and creates a client connected to it.
@@ -5115,7 +5115,7 @@
 	ss.cleanups = append(ss.cleanups, func() { lis.Close() })
 
 	s := grpc.NewServer(sopts...)
-	testpb.RegisterTestServiceService(s, testpb.NewTestServiceService(ss))
+	testpb.RegisterTestServiceService(s, ss.Svc())
 	go s.Serve(lis)
 	ss.cleanups = append(ss.cleanups, s.Stop)
 	ss.s = s
@@ -6258,7 +6258,7 @@
 
 	s := grpc.NewServer()
 	defer s.Stop()
-	testpb.RegisterTestServiceService(s, testpb.NewTestServiceService(ss))
+	testpb.RegisterTestServiceService(s, ss.Svc())
 
 	lis, err := net.Listen("tcp", "localhost:0")
 	if err != nil {
@@ -6477,7 +6477,7 @@
 	}
 
 	s := grpc.NewServer(grpc.WriteBufferSize(0), grpc.ReadBufferSize(0))
-	testpb.RegisterTestServiceService(s, testpb.NewTestServiceService(ss))
+	testpb.RegisterTestServiceService(s, ss.Svc())
 
 	lis, err := net.Listen("tcp", "localhost:0")
 	if err != nil {
diff --git a/test/goaway_test.go b/test/goaway_test.go
index 93d9648..1e00976 100644
--- a/test/goaway_test.go
+++ b/test/goaway_test.go
@@ -48,7 +48,7 @@
 
 	s := grpc.NewServer(grpc.KeepaliveParams(keepalive.ServerParameters{MaxConnectionAge: maxConnAge}))
 	defer s.Stop()
-	testpb.RegisterTestServiceService(s, testpb.NewTestServiceService(ss))
+	testpb.RegisterTestServiceService(s, ss.Svc())
 
 	lis, err := net.Listen("tcp", "localhost:0")
 	if err != nil {
diff --git a/test/gracefulstop_test.go b/test/gracefulstop_test.go
index f765952..1f5f1e7 100644
--- a/test/gracefulstop_test.go
+++ b/test/gracefulstop_test.go
@@ -117,7 +117,7 @@
 		},
 	}
 	s := grpc.NewServer()
-	testpb.RegisterTestServiceService(s, testpb.NewTestServiceService(ss))
+	testpb.RegisterTestServiceService(s, ss.Svc())
 
 	// 1. Start Server
 	wg := sync.WaitGroup{}
diff --git a/test/grpc_testing/test_grpc.pb.go b/test/grpc_testing/test_grpc.pb.go
index 7bcc9b0..45ae655 100644
--- a/test/grpc_testing/test_grpc.pb.go
+++ b/test/grpc_testing/test_grpc.pb.go
@@ -454,71 +454,3 @@
 
 	s.RegisterService(&sd, nil)
 }
-
-// NewTestServiceService creates a new TestServiceService containing the
-// implemented methods of the TestService service in s.  Any unimplemented
-// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
-// This includes situations where the method handler is misspelled or has the wrong
-// signature.  For this reason, this function should be used with great care and
-// is not recommended to be used by most users.
-func NewTestServiceService(s interface{}) *TestServiceService {
-	ns := &TestServiceService{}
-	if h, ok := s.(interface {
-		EmptyCall(context.Context, *Empty) (*Empty, error)
-	}); ok {
-		ns.EmptyCall = h.EmptyCall
-	}
-	if h, ok := s.(interface {
-		UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error)
-	}); ok {
-		ns.UnaryCall = h.UnaryCall
-	}
-	if h, ok := s.(interface {
-		StreamingOutputCall(*StreamingOutputCallRequest, TestService_StreamingOutputCallServer) error
-	}); ok {
-		ns.StreamingOutputCall = h.StreamingOutputCall
-	}
-	if h, ok := s.(interface {
-		StreamingInputCall(TestService_StreamingInputCallServer) error
-	}); ok {
-		ns.StreamingInputCall = h.StreamingInputCall
-	}
-	if h, ok := s.(interface {
-		FullDuplexCall(TestService_FullDuplexCallServer) error
-	}); ok {
-		ns.FullDuplexCall = h.FullDuplexCall
-	}
-	if h, ok := s.(interface {
-		HalfDuplexCall(TestService_HalfDuplexCallServer) error
-	}); ok {
-		ns.HalfDuplexCall = h.HalfDuplexCall
-	}
-	return ns
-}
-
-// UnstableTestServiceService is the service API for TestService service.
-// New methods may be added to this interface if they are added to the service
-// definition, which is not a backward-compatible change.  For this reason,
-// use of this type is not recommended.
-type UnstableTestServiceService interface {
-	// One empty request followed by one empty response.
-	EmptyCall(context.Context, *Empty) (*Empty, error)
-	// One request followed by one response.
-	// The server returns the client payload as-is.
-	UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error)
-	// One request followed by a sequence of responses (streamed download).
-	// The server returns the payload with client desired type and sizes.
-	StreamingOutputCall(*StreamingOutputCallRequest, TestService_StreamingOutputCallServer) error
-	// A sequence of requests followed by one response (streamed upload).
-	// The server returns the aggregated size of client payload as the result.
-	StreamingInputCall(TestService_StreamingInputCallServer) error
-	// A sequence of requests with each request served by the server immediately.
-	// As one request could lead to multiple responses, this interface
-	// demonstrates the idea of full duplexing.
-	FullDuplexCall(TestService_FullDuplexCallServer) error
-	// A sequence of requests followed by a sequence of responses.
-	// The server buffers all the client requests and then serves them in order. A
-	// stream of responses are returned to the client when the server starts with
-	// first request.
-	HalfDuplexCall(TestService_HalfDuplexCallServer) error
-}
diff --git a/test/local_creds_test.go b/test/local_creds_test.go
index 12af20b..86969c1 100644
--- a/test/local_creds_test.go
+++ b/test/local_creds_test.go
@@ -64,7 +64,7 @@
 	s := grpc.NewServer(sopts...)
 	defer s.Stop()
 
-	testpb.RegisterTestServiceService(s, testpb.NewTestServiceService(ss))
+	testpb.RegisterTestServiceService(s, ss.Svc())
 
 	lis, err := net.Listen(network, address)
 	if err != nil {
@@ -162,7 +162,7 @@
 	s := grpc.NewServer(sopts...)
 	defer s.Stop()
 
-	testpb.RegisterTestServiceService(s, testpb.NewTestServiceService(ss))
+	testpb.RegisterTestServiceService(s, ss.Svc())
 
 	lis, err := net.Listen("tcp", "localhost:0")
 	if err != nil {
