You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ti...@apache.org on 2020/07/08 04:29:06 UTC

[servicecomb-service-center] branch master updated: add more action for code quality (#657) (#660)

This is an automated email from the ASF dual-hosted git repository.

tianxiaoliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git


The following commit(s) were added to refs/heads/master by this push:
     new 6ad42e0  add more action for code quality (#657) (#660)
6ad42e0 is described below

commit 6ad42e0128d38866582e29d7b6c8ee1e60242a1c
Author: Shawn <xi...@gmail.com>
AuthorDate: Wed Jul 8 12:28:55 2020 +0800

    add more action for code quality (#657) (#660)
---
 .github/workflows/bench.yaml                       |  17 --
 .github/workflows/golangci-lint.yml                |  13 ++
 .github/workflows/reviewdog.yml                    |  30 ---
 .github/workflows/static_check.yml                 |   6 +-
 cmd/scserver/main.go                               |   1 +
 docs/user-guides/rbac.md                           |   3 +
 integration/instances_test.go                      |   4 +-
 pkg/backoff/backoff.go                             |   1 +
 pkg/buffer/pool.go                                 |   1 +
 pkg/cache/cache.go                                 |   1 +
 pkg/cache/config.go                                |   1 +
 pkg/cache/filter.go                                |   1 +
 pkg/cache/node.go                                  |   1 +
 pkg/cache/option.go                                |   1 +
 pkg/cache/tree.go                                  |   5 +-
 pkg/chain/callback.go                              |   1 +
 pkg/chain/chain.go                                 |   3 +-
 pkg/chain/handler.go                               |   5 +-
 pkg/chain/invocation.go                            |   3 +-
 pkg/client/sc/apis.go                              |  16 +-
 pkg/client/sc/client.go                            |   8 +-
 pkg/client/sc/client_lb.go                         |   2 +-
 pkg/client/sc/config.go                            |   2 +-
 pkg/client/sc/instance.go                          |  32 +--
 pkg/client/sc/microservice.go                      |  12 +-
 pkg/client/sc/schema.go                            |  30 +--
 pkg/client/sc/watch.go                             |   7 +-
 pkg/errors/error.go                                |   1 +
 pkg/etcdsync/mutex.go                              |  28 +--
 pkg/gopool/goroutines.go                           |   1 +
 pkg/grace/grace.go                                 |  25 +--
 pkg/log/log.go                                     |   2 +-
 pkg/log/log_test.go                                |  16 +-
 pkg/log/logger.go                                  |  22 +-
 pkg/log/logrotate.go                               |  12 +-
 pkg/log/logrotate_test.go                          |   4 +-
 pkg/log/zap.go                                     |  28 ++-
 {server/admin => pkg}/model/dump.go                |  11 +-
 {server/admin => pkg}/model/types.go               |   0
 pkg/notify/common.go                               |   1 +
 pkg/notify/group.go                                |   3 +-
 pkg/notify/group_test.go                           |   6 +-
 pkg/notify/notice.go                               |   1 +
 pkg/notify/notification_healthchecker.go           |  25 +--
 pkg/notify/notification_service.go                 |  28 +--
 pkg/notify/notification_test.go                    |   1 +
 pkg/notify/processor.go                            |   4 +-
 pkg/notify/processor_test.go                       |   2 +-
 pkg/notify/subject.go                              |   1 +
 pkg/notify/subscriber.go                           |  31 +--
 pkg/plugin/loader.go                               |   7 +-
 pkg/plugin/loader_test.go                          |   2 +-
 pkg/queue/uniqueue.go                              |   3 +-
 pkg/queue/uniqueue_test.go                         |   2 +-
 pkg/rest/client.go                                 |  44 ++--
 pkg/rest/common.go                                 |  44 ++--
 pkg/rest/conn.go                                   |   1 +
 pkg/rest/listener.go                               |  22 +-
 pkg/rest/roa.go                                    |   1 +
 pkg/rest/route.go                                  |  13 +-
 pkg/rest/server.go                                 |  11 +-
 pkg/rpc/grpc.go                                    |   1 +
 pkg/task/executor.go                               |   7 +-
 pkg/task/service.go                                |   5 +-
 pkg/task/service_async.go                          |   3 +-
 pkg/task/task.go                                   |   4 +-
 pkg/tlsutil/common.go                              |   7 +-
 pkg/tlsutil/tls13.go                               |   2 +-
 pkg/tlsutil/tlsutil.go                             |  10 +-
 {server/service => pkg}/util/common.go             |  13 +-
 pkg/util/concurrent_map_go19.go                    |   1 -
 pkg/util/context.go                                |   1 +
 pkg/util/net.go                                    |   9 +-
 pkg/util/net_test.go                               |   8 +-
 pkg/util/reflect.go                                |  17 +-
 pkg/util/sys.go                                    |   1 +
 pkg/util/tree.go                                   |  19 +-
 pkg/util/util.go                                   |   1 +
 pkg/util/uuid.go                                   |   3 +-
 pkg/util/uuid_test.go                              |   2 +-
 pkg/validate/func.go                               |   3 +-
 pkg/validate/rule.go                               |  13 +-
 pkg/validate/url.go                                |   1 +
 pkg/validate/validator.go                          |  13 +-
 pkg/validate/validator_test.go                     |  32 +--
 {pkg/client => scctl}/etcd/client.go               |   2 +-
 {pkg/client => scctl}/etcd/config.go               |   0
 scctl/pkg/model/types.go                           |   6 +-
 scctl/pkg/plugin/diagnose/cmd.go                   |   2 +-
 scctl/pkg/plugin/diagnose/compare_holder.go        |   2 +-
 scctl/pkg/plugin/diagnose/compare_holder_test.go   |  16 +-
 scctl/pkg/plugin/diagnose/diagnose.go              |   4 +-
 scctl/pkg/plugin/diagnose/diagnose_test.go         |  26 +--
 scctl/pkg/plugin/get/instance/instance_cmd.go      |   4 +-
 scctl/pkg/plugin/get/schema/schema_cmd.go          |  10 +-
 scctl/pkg/version/version.go                       |   4 +-
 scripts/build/local.sh                             |   2 +-
 server/alarm/common.go                             |  12 +-
 server/alarm/model/types.go                        |   2 +-
 server/alarm/service.go                            |  40 ++--
 server/api.go                                      |   5 +-
 server/bootstrap/bootstrap.go                      |  36 ++--
 server/broker/broker.go                            |   3 +-
 server/broker/broker_key_generator.go              |  73 +++----
 server/broker/broker_suite_test.go                 |   2 +-
 server/broker/controller.go                        |  98 +++++----
 server/broker/controller_test.go                   |   2 +-
 server/broker/service.go                           |  93 +++++----
 server/broker/service_test.go                      |   5 +-
 server/broker/store.go                             |  19 +-
 server/broker/util.go                              |  90 ++++-----
 server/core/backend/addon.go                       |   1 +
 server/core/backend/common.go                      |  42 ++--
 server/core/backend/defer_instance.go              |   1 +
 server/core/backend/discovery.go                   |  27 +--
 server/core/backend/lease.go                       |   5 +-
 server/core/backend/lease_test.go                  |   2 +-
 server/core/backend/metrics.go                     |   3 +-
 server/core/backend/registry.go                    |  56 ++++--
 server/core/config.go                              |   1 +
 server/core/core.go                                |   3 +-
 server/core/key_convertor.go                       |  28 +--
 server/core/key_convertor_test.go                  |   4 +-
 server/core/key_generator.go                       | 163 +++++++--------
 server/core/microservice.go                        |  47 ++---
 server/handler/accesslog/handler.go                |  12 +-
 server/handler/accesslog/handler_test.go           |   6 +-
 server/handler/auth/auth.go                        |   5 +-
 server/handler/cache/cache.go                      |  24 +--
 server/handler/context/context.go                  |  11 +-
 server/handler/context/v3.go                       |   9 +-
 server/handler/context/v4.go                       |   3 +-
 server/handler/maxbody/maxbody.go                  |  13 +-
 server/handler/metric/metric.go                    |   9 +-
 server/handler/tracing/tracing.go                  |  15 +-
 server/health/health.go                            |   2 +-
 server/health/health_test.go                       |   6 +-
 server/init/init.go                                |   1 +
 server/interceptor/access/access.go                |   8 +-
 server/interceptor/cors/cors.go                    |   1 +
 server/interceptor/interceptors.go                 |  11 +-
 server/metric/calculator.go                        |   1 +
 server/metric/common.go                            |  17 +-
 server/metric/gatherer.go                          |   1 +
 server/metric/metrics.go                           |  11 +-
 server/metric/prometheus/metrics.go                |  10 +-
 server/metric/reporter.go                          |   1 +
 server/mux/mux.go                                  |  15 +-
 server/notify/center.go                            |   4 +-
 server/notify/listwatcher.go                       |  22 +-
 server/notify/metrics.go                           |   2 +-
 server/notify/publisher.go                         |   1 +
 server/notify/stream.go                            |  36 ++--
 server/notify/websocket.go                         |  41 ++--
 server/notify/websocket_test.go                    |   4 +-
 server/plugin/auditlog/auditlog.go                 |   1 +
 server/plugin/auth/auth.go                         |   1 +
 server/plugin/auth/buildin/buildin.go              |   5 +-
 server/plugin/discovery/aggregate/adaptor.go       |  18 +-
 server/plugin/discovery/aggregate/cache.go         |   2 +-
 server/plugin/discovery/aggregate/repo.go          |   8 +-
 server/plugin/discovery/cache_kv.go                |   2 +-
 server/plugin/discovery/common.go                  |   4 +-
 server/plugin/discovery/config.go                  |   4 +-
 server/plugin/discovery/etcd/adaptor.go            |  16 +-
 server/plugin/discovery/etcd/adaptor_test.go       |   8 +-
 server/plugin/discovery/etcd/cacher_kv.go          |  10 +-
 server/plugin/discovery/etcd/cacher_kv_test.go     |   8 +-
 server/plugin/discovery/etcd/common.go             |   4 +-
 server/plugin/discovery/etcd/indexer_cache.go      |  10 +-
 server/plugin/discovery/etcd/indexer_etcd.go       |  16 +-
 server/plugin/discovery/etcd/indexer_test.go       |   4 +-
 server/plugin/discovery/etcd/listwatch_inner.go    |   3 +-
 server/plugin/discovery/etcd/listwatch_test.go     |   2 +-
 server/plugin/discovery/etcd/repo.go               |  10 +-
 server/plugin/discovery/etcd/watcher_inner.go      |   2 +
 server/plugin/discovery/indexer_cache.go           |   2 +-
 server/plugin/discovery/k8s/adaptor/cacher.go      |   2 +-
 .../plugin/discovery/k8s/adaptor/cacher_index.go   |   4 +-
 .../discovery/k8s/adaptor/cacher_instance.go       |  26 +--
 .../plugin/discovery/k8s/adaptor/cacher_service.go |   4 +-
 server/plugin/discovery/k8s/adaptor/common.go      |   4 +-
 server/plugin/discovery/k8s/adaptor/convertor.go   |   2 +-
 server/plugin/discovery/k8s/adaptor/kube_client.go |  11 +-
 server/plugin/discovery/k8s/repo.go                |   8 +-
 server/plugin/discovery/metrics.go                 |   2 +-
 server/plugin/discovery/servicecenter/adaptor.go   |  27 ++-
 server/plugin/discovery/servicecenter/aggregate.go |  38 ++--
 server/plugin/discovery/servicecenter/cacher.go    |   8 +-
 server/plugin/discovery/servicecenter/indexer.go   |  16 +-
 server/plugin/discovery/servicecenter/repo.go      |   8 +-
 server/plugin/discovery/servicecenter/syncer.go    |  43 ++--
 .../plugin/discovery/servicecenter/syncer_test.go  |  60 +++---
 server/plugin/discovery/types.go                   |   6 +-
 server/plugin/export.go                            |   8 +-
 server/plugin/plugin.go                            |   3 +-
 server/plugin/quota/buildin/buildin.go             |  11 +-
 server/plugin/quota/buildin/common.go              |   9 +-
 server/plugin/quota/buildin/counter.go             |   4 +-
 server/plugin/quota/buildin/counter_test.go        |  10 +-
 server/plugin/quota/counter/event.go               |  10 +-
 server/plugin/quota/counter/event_test.go          |  38 ++--
 server/plugin/quota/quota.go                       |  16 +-
 server/plugin/quota/unlimit/unlimit.go             |   3 +-
 server/plugin/registry/buildin/buildin.go          |  31 +--
 server/plugin/registry/common.go                   |  30 +--
 server/plugin/registry/config.go                   |   2 +-
 server/plugin/registry/embededetcd/embededetcd.go  |  45 ++---
 server/plugin/registry/etcd/common.go              |   3 +-
 server/plugin/registry/etcd/etcd.go                | 123 ++++++------
 server/plugin/registry/etcd/etcd_test.go           |  38 ++--
 server/plugin/registry/etcd/logger.go              |   1 +
 server/plugin/registry/etcd/tracing.go             |   1 +
 server/plugin/registry/metrics.go                  |   3 +-
 server/plugin/registry/option.go                   |  30 +--
 server/plugin/registry/registry.go                 |   1 +
 server/plugin/registry/types.go                    |  28 +--
 server/plugin/security/buildin/buildin.go          |   3 +-
 server/plugin/tls/buildin/buildin.go               |   3 +-
 server/plugin/tls/buildin/tls.go                   |   1 +
 server/plugin/tls/tls.go                           |   1 +
 server/plugin/tracing/pzipkin/buildin.go           |  20 +-
 server/plugin/tracing/pzipkin/buildin_test.go      |   2 +-
 server/plugin/tracing/pzipkin/common.go            |   1 +
 server/plugin/tracing/pzipkin/file_collector.go    |  13 +-
 server/plugin/tracing/pzipkin/span.go              |   9 +-
 server/plugin/tracing/tracing.go                   |   3 +-
 server/plugin/uuid/buildin/buildin.go              |  18 +-
 server/plugin/uuid/context/context.go              |  14 +-
 server/plugin/uuid/uuid.go                         |   9 +-
 server/{ => rest}/admin/admin.go                   |   3 +-
 server/{ => rest}/admin/controller_v4.go           |  25 +--
 server/{ => rest}/admin/service.go                 |  19 +-
 server/{ => rest}/admin/service_test.go            |  11 +-
 server/rest/controller/rest_util.go                |  40 ++--
 server/rest/controller/v3/dependency_controller.go |   8 +-
 server/rest/controller/v3/instance_controller.go   |  18 +-
 server/rest/controller/v3/instance_watcher.go      |   4 +-
 server/rest/controller/v3/main_controller.go       |  16 +-
 .../rest/controller/v3/microservice_controller.go  |  14 +-
 server/rest/controller/v3/query_rule_controller.go |   8 +-
 server/rest/controller/v3/schema_controller.go     |  10 +-
 server/rest/controller/v3/tag_controller.go        |   8 +-
 server/rest/controller/v4/auth_resource.go         |  23 ++-
 server/rest/controller/v4/dependency_controller.go |  25 ++-
 server/rest/controller/v4/instance_controller.go   |  72 ++++---
 server/rest/controller/v4/instance_watcher.go      |  11 +-
 server/rest/controller/v4/main_controller.go       |  25 +--
 .../rest/controller/v4/microservice_controller.go  |  50 +++--
 server/rest/controller/v4/query_rule_controller.go |  33 ++-
 server/rest/controller/v4/schema_controller.go     |  41 ++--
 server/rest/controller/v4/tag_controller.go        |  24 ++-
 server/rest/controller/v4/v4.go                    |   1 +
 server/{ => rest}/govern/README.md                 |   2 +-
 server/{ => rest}/govern/controller_v3.go          |  15 +-
 server/{ => rest}/govern/controller_v4.go          |  33 +--
 server/{ => rest}/govern/govern.go                 |   7 +-
 server/{ => rest}/govern/govern_suite_test.go      |   7 +-
 server/{ => rest}/govern/graph.go                  |   3 +-
 server/{ => rest}/govern/service.go                |  65 +++---
 server/{ => rest}/govern/service_test.go           |   6 +-
 server/rest/handler.go                             |   4 +-
 server/rest/pprof.go                               |   1 +
 server/rest/server.go                              |   1 +
 server/rest/server_mux.go                          |   1 +
 server/rpc/server.go                               |   1 +
 server/scerror/error.go                            |  10 +-
 server/server.go                                   |  38 ++--
 server/service/cache/common.go                     |  17 +-
 server/service/cache/dependency.go                 |  15 +-
 server/service/cache/filter_consistency.go         |  21 +-
 server/service/cache/filter_consumer.go            |   5 +-
 server/service/cache/filter_instances.go           |  27 +--
 server/service/cache/filter_permission.go          |  19 +-
 server/service/cache/filter_service.go             |   3 +-
 server/service/cache/filter_tags.go                |  19 +-
 server/service/cache/filter_version.go             |  13 +-
 server/service/cache/instance.go                   |  23 ++-
 server/service/dependency.go                       |  27 +--
 server/service/dependency_validator.go             |  17 +-
 server/service/event/dependency_event_handler.go   |  41 ++--
 .../service/event/dependency_rule_event_handler.go |   4 +-
 server/service/event/instance_event_handler.go     |  36 ++--
 server/service/event/rule_event_handler.go         |  42 ++--
 .../service/event/schema_summary_event_handler.go  |   2 +-
 server/service/event/tag_event_handler.go          |  56 +++---
 server/service/instance.go                         | 126 ++++++------
 server/service/instance_test.go                    |  15 +-
 server/service/instance_validator.go               |  37 ++--
 server/service/kv/store.go                         |   8 +
 server/service/metrics/metrics.go                  |   1 +
 server/service/microservice.go                     | 137 ++++++-------
 server/service/microservice_validator.go           |  45 +++--
 server/service/rbac/authr_plugin.go                |   1 -
 pkg/task/task.go => server/service/rbac/context.go |  30 +--
 server/service/rbac/dao/account_dao.go             |  16 +-
 server/service/rbac/password.go                    |  12 +-
 server/service/rbac/rbac.go                        |  10 +-
 server/service/rbac/rbca_test.go                   |  11 +-
 server/service/rule.go                             |  27 +--
 server/service/rule_validator.go                   |  11 +-
 server/service/schema.go                           | 222 ++++++++++-----------
 server/service/schema_test.go                      |   8 +-
 server/service/schema_validator.go                 |  13 +-
 server/service/service.go                          |   1 +
 server/service/service_suite_test.go               |   3 +-
 server/service/tag.go                              |   3 +-
 server/service/tag_test.go                         |  11 +-
 server/service/tag_validator.go                    |   7 +-
 server/service/util/dependency_query.go            |  60 +++---
 server/service/util/dependency_test.go             |   2 +-
 server/service/util/dependency_util.go             |  42 ++--
 server/service/util/domain_util.go                 |   4 +-
 server/service/util/heartbeat_util.go              |  12 +-
 server/service/util/instance_util.go               |  77 +++----
 server/service/util/instance_util_test.go          |  18 +-
 server/service/util/microservice_util.go           |  34 ++--
 server/service/util/rule_util.go                   |  80 ++++----
 server/service/util/rule_util_test.go              |   2 +-
 server/service/util/tag_util.go                    |  14 +-
 server/service/util/util.go                        |   7 +-
 server/service/util/util_suite_test.go             |  10 +-
 server/service/validate.go                         |   1 +
 server/service/watch.go                            |   5 +-
 server/task/clear_service_test.go                  |   3 +-
 server/version.go                                  |   1 +
 syncer/config/verify.go                            |   2 +-
 syncer/pkg/mock/mockservicecenter/servicecenter.go |  16 +-
 syncer/plugins/eureka/eureka.go                    |   2 +-
 syncer/plugins/plugin.go                           |   2 +-
 syncer/plugins/servicecenter/schemas.go            |   4 +-
 syncer/plugins/servicecenter/servicecenter.go      |   6 +-
 syncer/plugins/servicecenter/servicecenter_test.go |   3 +-
 syncer/plugins/servicecenter/transform.go          |   2 +-
 .../hello-server/servicecenter/servicecenter.go    |  11 +-
 syncer/version/version.go                          |   4 +-
 version/version.go                                 |  21 +-
 337 files changed, 2799 insertions(+), 2454 deletions(-)

diff --git a/.github/workflows/bench.yaml b/.github/workflows/bench.yaml
deleted file mode 100644
index d20c921..0000000
--- a/.github/workflows/bench.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: gobenchdata publish
-on: push
-jobs:
-  publish:
-    runs-on: ubuntu-latest
-    steps:
-      - name: checkout
-        uses: actions/checkout@v2
-      - name: gobenchdata publish
-        uses: bobheadxi/gobenchdata@v1
-        with:
-          PRUNE_COUNT: 30
-          GO_TEST_FLAGS: -cpu 1,2
-          PUBLISH: true
-          PUBLISH_BRANCH: gh-pages
-        env:
-          GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
\ No newline at end of file
diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml
new file mode 100644
index 0000000..bce3d29
--- /dev/null
+++ b/.github/workflows/golangci-lint.yml
@@ -0,0 +1,13 @@
+name: golangci-lint
+on: [push, pull_request]
+jobs:
+  golangci:
+    name: lint
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: golangci-lint
+        uses: golangci/golangci-lint-action@v1
+        with:
+          version: v1.27
+          args: --timeout=5m --skip-dirs=pkg/cache,server/plugin/discovery,server/service/event,server/service/util,server/bootstrap,server/notify,server/rest/controller/v3,server/broker/brokerpb,examples,syncer,frontend,scctl,integration,server/core/proto --out-format=colored-line-number --enable golint,gocyclo --skip-files=.*_test.go$
\ No newline at end of file
diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml
deleted file mode 100644
index da26b99..0000000
--- a/.github/workflows/reviewdog.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-name: reviewdog
-on: [pull_request]
-jobs:
-  # Use golint via golangci-lint binary with "warning" level.
-  golint:
-    name: runner / golint
-    runs-on: ubuntu-latest
-    steps:
-      - name: Check out code into the Go module directory
-        uses: actions/checkout@v1
-      - name: golint
-        uses: reviewdog/action-golangci-lint@v1
-        with:
-          golangci_lint_flags: "--disable-all -E golint"
-          tool_name: golint # Change reporter name.
-          level: warning # GitHub Status Check won't become failure with this level.
-
-  # You can add more and more supported linters with different config.
-  errcheck:
-    name: runner / errcheck
-    runs-on: ubuntu-latest
-    steps:
-      - name: Check out code into the Go module directory
-        uses: actions/checkout@v1
-      - name: errcheck
-        uses: reviewdog/action-golangci-lint@v1
-        with:
-          golangci_lint_flags: "--disable-all -E errcheck"
-          tool_name: errcheck
-          level: info
\ No newline at end of file
diff --git a/.github/workflows/static_check.yml b/.github/workflows/static_check.yml
index 57eb088..1ddf9f6 100644
--- a/.github/workflows/static_check.yml
+++ b/.github/workflows/static_check.yml
@@ -37,8 +37,4 @@ jobs:
     - name: Misspell
       run: |
         go get -u github.com/client9/misspell/cmd/misspell
-        bash scripts/ci/formatChecker.sh
-    - name: Cyclo
-      run: |
-        go get github.com/fzipp/gocyclo
-        bash scripts/ci/goCycloChecker.sh
\ No newline at end of file
+        bash scripts/ci/formatChecker.sh
\ No newline at end of file
diff --git a/cmd/scserver/main.go b/cmd/scserver/main.go
index 1e78994..7ddb510 100644
--- a/cmd/scserver/main.go
+++ b/cmd/scserver/main.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package main
 
 import _ "github.com/apache/servicecomb-service-center/server/init"
diff --git a/docs/user-guides/rbac.md b/docs/user-guides/rbac.md
index 6116ab9..bce3491 100644
--- a/docs/user-guides/rbac.md
+++ b/docs/user-guides/rbac.md
@@ -58,6 +58,7 @@ curl -X GET \
 
 ### Change password
 You must supply current password and token to update to new password
+```shell script
 curl -X PUT \
   http://127.0.0.1:30100/v4/account-password \
   -H 'Authorization: Bear eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50Ijoicm9vdCIsImV4cCI6MTU5MzMyOTE3OSwicm9sZSI6IiJ9.OR_uruuLds1wz10_J4gDEA-L9Ma_1RrHiKEA6CS-Nilv6hHB5KyhZ9_4qqf_c0iia4uKryAGHKsXUvrjOE51tz4QCXlgCmddrkYuLQsnDezXhV3TIqzdl4R_cy8h2cZo8O_b_q7eU2Iemd6x7BJE49SLgNiP5LTXCVct5Qm_GiXYTaM4dbHIJ01V-EPmNQuBr1vKdfNa8cqWtASSp9IEkFx1YpzhFacQgmfoiSGHvxQYZldQXuAh60ZXLBDexGu6jGnG39MqVNRysvHTpZRqxZWBhmEn5DeXpgKu-zlakJMjeEma4zcN-H0MumE-nMlBT5kjKWVr1DOdtOyJI6i786ZpS0wWHV4VOxpSursoKsW_XuTZ [...]
@@ -65,6 +66,8 @@ curl -X PUT \
 	"currentPassword":"rootpwd",
 	"password":"123"
 }'
+```
+
 ### Roles TODO
 currently, you can not custom and manage any role and role policy. there is only 1 build in roles
 - admin: able to do anything, including manage account, even change other account password
diff --git a/integration/instances_test.go b/integration/instances_test.go
index 6f49e5a..0f90d31 100644
--- a/integration/instances_test.go
+++ b/integration/instances_test.go
@@ -275,7 +275,7 @@ var _ = Describe("MicroService Api Test", func() {
 				Expect(resp.StatusCode).To(Equal(http.StatusBadRequest))
 			})
 
-			It("Find Micro-Service Instance by ServiceId", func() {
+			It("Find Micro-Service Instance by ServiceID", func() {
 				url := strings.Replace(GETINSTANCE, ":serviceId", serviceId, 1)
 				req, _ := http.NewRequest(GET, SCURL+url, nil)
 				req.Header.Set("X-Domain-Name", "default")
@@ -295,7 +295,7 @@ var _ = Describe("MicroService Api Test", func() {
 				Expect(foundMicroServiceInstance).To(Equal(true))
 			})
 
-			It("Find Micro-Service Instance by Invalid ServiceId", func() {
+			It("Find Micro-Service Instance by Invalid ServiceID", func() {
 				url := strings.Replace(GETINSTANCE, ":serviceId", "XX", 1)
 				req, _ := http.NewRequest(GET, SCURL+url, nil)
 				req.Header.Set("X-Domain-Name", "default")
diff --git a/pkg/backoff/backoff.go b/pkg/backoff/backoff.go
index aa02747..9132628 100644
--- a/pkg/backoff/backoff.go
+++ b/pkg/backoff/backoff.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package backoff
 
 import (
diff --git a/pkg/buffer/pool.go b/pkg/buffer/pool.go
index 66d7ecd..048c7ff 100644
--- a/pkg/buffer/pool.go
+++ b/pkg/buffer/pool.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package buffer
 
 import (
diff --git a/pkg/cache/cache.go b/pkg/cache/cache.go
index 3d02aba..c32cf98 100644
--- a/pkg/cache/cache.go
+++ b/pkg/cache/cache.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package cache
 
 import (
diff --git a/pkg/cache/config.go b/pkg/cache/config.go
index fac805d..12173f4 100644
--- a/pkg/cache/config.go
+++ b/pkg/cache/config.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package cache
 
 import "time"
diff --git a/pkg/cache/filter.go b/pkg/cache/filter.go
index 234fbb2..ecd4261 100644
--- a/pkg/cache/filter.go
+++ b/pkg/cache/filter.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package cache
 
 import "context"
diff --git a/pkg/cache/node.go b/pkg/cache/node.go
index 400c669..2bdd0b8 100644
--- a/pkg/cache/node.go
+++ b/pkg/cache/node.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package cache
 
 import "github.com/apache/servicecomb-service-center/pkg/util"
diff --git a/pkg/cache/option.go b/pkg/cache/option.go
index 4250ca1..5baea99 100644
--- a/pkg/cache/option.go
+++ b/pkg/cache/option.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package cache
 
 type Option struct {
diff --git a/pkg/cache/tree.go b/pkg/cache/tree.go
index f7fbbf8..b1f8ceb 100644
--- a/pkg/cache/tree.go
+++ b/pkg/cache/tree.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package cache
 
 import (
@@ -34,9 +35,7 @@ type Tree struct {
 
 func (t *Tree) AddFilter(fs ...Filter) *Tree {
 	t.lock.Lock()
-	for _, f := range fs {
-		t.filters = append(t.filters, f)
-	}
+	t.filters = append(t.filters, fs...)
 	t.lock.Unlock()
 	return t
 }
diff --git a/pkg/chain/callback.go b/pkg/chain/callback.go
index 784ee19..20c9219 100644
--- a/pkg/chain/callback.go
+++ b/pkg/chain/callback.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package chain
 
 import (
diff --git a/pkg/chain/chain.go b/pkg/chain/chain.go
index a1ddd30..f8ecda1 100644
--- a/pkg/chain/chain.go
+++ b/pkg/chain/chain.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package chain
 
 type Chain struct {
@@ -37,7 +38,7 @@ func (c *Chain) syncNext(i *Invocation) {
 		i.Success()
 		return
 	}
-	c.currentIndex += 1
+	c.currentIndex++
 	c.handlers[c.currentIndex].Handle(i)
 }
 
diff --git a/pkg/chain/handler.go b/pkg/chain/handler.go
index 3a88a3b..c596bf8 100644
--- a/pkg/chain/handler.go
+++ b/pkg/chain/handler.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package chain
 
 import (
@@ -21,7 +22,7 @@ import (
 	"github.com/apache/servicecomb-service-center/pkg/util"
 )
 
-const CAP_SIZE = 10
+const CapSize = 10
 
 var handlersMap = make(map[string][]Handler)
 
@@ -32,7 +33,7 @@ type Handler interface {
 func RegisterHandler(catalog string, h Handler) {
 	handlers, ok := handlersMap[catalog]
 	if !ok {
-		handlers = make([]Handler, 0, CAP_SIZE)
+		handlers = make([]Handler, 0, CapSize)
 	}
 	handlers = append(handlers, h)
 	handlersMap[catalog] = handlers
diff --git a/pkg/chain/invocation.go b/pkg/chain/invocation.go
index a4a391a..6d87500 100644
--- a/pkg/chain/invocation.go
+++ b/pkg/chain/invocation.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package chain
 
 import (
@@ -101,7 +102,7 @@ func (i *Invocation) Invoke(f CallbackFunc) {
 		if itf == nil {
 			return
 		}
-		log.LogPanic(itf)
+		log.Panic(itf)
 
 		i.Fail(errorsEx.RaiseError(itf))
 	}()
diff --git a/pkg/client/sc/apis.go b/pkg/client/sc/apis.go
index 54af341..602c734 100644
--- a/pkg/client/sc/apis.go
+++ b/pkg/client/sc/apis.go
@@ -21,8 +21,8 @@ import (
 	"io/ioutil"
 	"net/http"
 
+	"github.com/apache/servicecomb-service-center/pkg/model"
 	"github.com/apache/servicecomb-service-center/pkg/util"
-	"github.com/apache/servicecomb-service-center/server/admin/model"
 	"github.com/apache/servicecomb-service-center/server/plugin/registry"
 	scerr "github.com/apache/servicecomb-service-center/server/scerror"
 	"github.com/apache/servicecomb-service-center/version"
@@ -37,7 +37,7 @@ const (
 	QueryGlobal = "global"
 )
 
-func (c *SCClient) toError(body []byte) *scerr.Error {
+func (c *Client) toError(body []byte) *scerr.Error {
 	message := new(scerr.Error)
 	err := json.Unmarshal(body, message)
 	if err != nil {
@@ -46,7 +46,7 @@ func (c *SCClient) toError(body []byte) *scerr.Error {
 	return message
 }
 
-func (c *SCClient) parseQuery(ctx context.Context) (q string) {
+func (c *Client) parseQuery(ctx context.Context) (q string) {
 	switch {
 	case ctx.Value(QueryGlobal) == "1":
 		q += "global=true"
@@ -56,7 +56,7 @@ func (c *SCClient) parseQuery(ctx context.Context) (q string) {
 	return
 }
 
-func (c *SCClient) GetScVersion(ctx context.Context) (*version.VersionSet, *scerr.Error) {
+func (c *Client) GetScVersion(ctx context.Context) (*version.Set, *scerr.Error) {
 	resp, err := c.RestDoWithContext(ctx, http.MethodGet, apiVersionURL, c.CommonHeaders(ctx), nil)
 	if err != nil {
 		return nil, scerr.NewError(scerr.ErrInternal, err.Error())
@@ -72,7 +72,7 @@ func (c *SCClient) GetScVersion(ctx context.Context) (*version.VersionSet, *scer
 		return nil, c.toError(body)
 	}
 
-	v := &version.VersionSet{}
+	v := &version.Set{}
 	err = json.Unmarshal(body, v)
 	if err != nil {
 		return nil, scerr.NewError(scerr.ErrInternal, err.Error())
@@ -81,7 +81,7 @@ func (c *SCClient) GetScVersion(ctx context.Context) (*version.VersionSet, *scer
 	return v, nil
 }
 
-func (c *SCClient) GetScCache(ctx context.Context) (*model.Cache, *scerr.Error) {
+func (c *Client) GetScCache(ctx context.Context) (*model.Cache, *scerr.Error) {
 	headers := c.CommonHeaders(ctx)
 	// only default domain has admin permission
 	headers.Set("X-Domain-Name", "default")
@@ -109,7 +109,7 @@ func (c *SCClient) GetScCache(ctx context.Context) (*model.Cache, *scerr.Error)
 	return dump.Cache, nil
 }
 
-func (c *SCClient) GetClusters(ctx context.Context) (registry.Clusters, *scerr.Error) {
+func (c *Client) GetClusters(ctx context.Context) (registry.Clusters, *scerr.Error) {
 	headers := c.CommonHeaders(ctx)
 	// only default domain has admin permission
 	headers.Set("X-Domain-Name", "default")
@@ -137,7 +137,7 @@ func (c *SCClient) GetClusters(ctx context.Context) (registry.Clusters, *scerr.E
 	return clusters.Clusters, nil
 }
 
-func (c *SCClient) HealthCheck(ctx context.Context) *scerr.Error {
+func (c *Client) HealthCheck(ctx context.Context) *scerr.Error {
 	headers := c.CommonHeaders(ctx)
 	// only default domain has admin permission
 	headers.Set("X-Domain-Name", "default")
diff --git a/pkg/client/sc/client.go b/pkg/client/sc/client.go
index 6279328..cd77f2b 100644
--- a/pkg/client/sc/client.go
+++ b/pkg/client/sc/client.go
@@ -20,20 +20,20 @@ import (
 	"net/http"
 )
 
-func NewSCClient(cfg Config) (*SCClient, error) {
+func NewSCClient(cfg Config) (*Client, error) {
 	client, err := NewLBClient(cfg.Endpoints, cfg.Merge())
 	if err != nil {
 		return nil, err
 	}
-	return &SCClient{LBClient: client, Cfg: cfg}, nil
+	return &Client{LBClient: client, Cfg: cfg}, nil
 }
 
-type SCClient struct {
+type Client struct {
 	*LBClient
 	Cfg Config
 }
 
-func (c *SCClient) CommonHeaders(ctx context.Context) http.Header {
+func (c *Client) CommonHeaders(ctx context.Context) http.Header {
 	var headers = make(http.Header)
 	// TODO overwrote by context values
 	if len(c.Cfg.Token) > 0 {
diff --git a/pkg/client/sc/client_lb.go b/pkg/client/sc/client_lb.go
index de0a904..89af078 100644
--- a/pkg/client/sc/client_lb.go
+++ b/pkg/client/sc/client_lb.go
@@ -51,7 +51,7 @@ func (c *LBClient) RestDoWithContext(ctx context.Context, method string, api str
 	var errs []string
 	for i := 0; i < c.Retries; i++ {
 		addr := c.Next()
-		resp, err = c.HttpDoWithContext(ctx, method, addr+api, headers, body)
+		resp, err = c.HTTPDoWithContext(ctx, method, addr+api, headers, body)
 		if err != nil {
 			errs = append(errs, fmt.Sprintf("[%s]: %s", addr, err.Error()))
 			continue
diff --git a/pkg/client/sc/config.go b/pkg/client/sc/config.go
index 1a8e4bb..1f7e975 100644
--- a/pkg/client/sc/config.go
+++ b/pkg/client/sc/config.go
@@ -34,7 +34,7 @@ type Config struct {
 }
 
 func (cfg *Config) Merge() rest.URLClientOption {
-	ssl := strings.Index(cfg.Endpoints[0], "https://") >= 0
+	ssl := strings.Contains(cfg.Endpoints[0], "https://")
 	if ssl && len(cfg.CertKeyPWD) == 0 && len(cfg.CertKeyPWDPath) > 0 {
 		content, _ := ioutil.ReadFile(cfg.CertKeyPWDPath)
 		cfg.CertKeyPWD = string(content)
diff --git a/pkg/client/sc/instance.go b/pkg/client/sc/instance.go
index f2d2a6a..cc20801 100644
--- a/pkg/client/sc/instance.go
+++ b/pkg/client/sc/instance.go
@@ -36,7 +36,7 @@ const (
 	apiInstanceHeartbeatURL  = "/v4/%s/registry/microservices/%s/instances/%s/heartbeat"
 )
 
-func (c *SCClient) RegisterInstance(ctx context.Context, domainProject, serviceId string, instance *pb.MicroServiceInstance) (string, *scerr.Error) {
+func (c *Client) RegisterInstance(ctx context.Context, domainProject, serviceID string, instance *pb.MicroServiceInstance) (string, *scerr.Error) {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
@@ -47,7 +47,7 @@ func (c *SCClient) RegisterInstance(ctx context.Context, domainProject, serviceI
 	}
 
 	resp, err := c.RestDoWithContext(ctx, http.MethodPost,
-		fmt.Sprintf(apiInstancesURL, project, serviceId),
+		fmt.Sprintf(apiInstancesURL, project, serviceID),
 		headers, reqBody)
 	if err != nil {
 		return "", scerr.NewError(scerr.ErrInternal, err.Error())
@@ -71,13 +71,13 @@ func (c *SCClient) RegisterInstance(ctx context.Context, domainProject, serviceI
 	return instancesResp.InstanceId, nil
 }
 
-func (c *SCClient) UnregisterInstance(ctx context.Context, domainProject, serviceId, instanceId string) *scerr.Error {
+func (c *Client) UnregisterInstance(ctx context.Context, domainProject, serviceID, instanceID string) *scerr.Error {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
 
 	resp, err := c.RestDoWithContext(ctx, http.MethodDelete,
-		fmt.Sprintf(apiInstanceURL, project, serviceId, instanceId),
+		fmt.Sprintf(apiInstanceURL, project, serviceID, instanceID),
 		headers, nil)
 	if err != nil {
 		return scerr.NewError(scerr.ErrInternal, err.Error())
@@ -96,14 +96,14 @@ func (c *SCClient) UnregisterInstance(ctx context.Context, domainProject, servic
 	return nil
 }
 
-func (c *SCClient) DiscoveryInstances(ctx context.Context, domainProject, consumerId, providerAppId, providerServiceName, providerVersionRule string) ([]*pb.MicroServiceInstance, *scerr.Error) {
+func (c *Client) DiscoveryInstances(ctx context.Context, domainProject, consumerID, providerAppID, providerServiceName, providerVersionRule string) ([]*pb.MicroServiceInstance, *scerr.Error) {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
-	headers.Set("X-ConsumerId", consumerId)
+	headers.Set("X-ConsumerId", consumerID)
 
 	query := url.Values{}
-	query.Set("appId", providerAppId)
+	query.Set("appId", providerAppID)
 	query.Set("serviceName", providerServiceName)
 	query.Set("version", providerVersionRule)
 
@@ -133,13 +133,13 @@ func (c *SCClient) DiscoveryInstances(ctx context.Context, domainProject, consum
 	return instancesResp.Instances, nil
 }
 
-func (c *SCClient) Heartbeat(ctx context.Context, domainProject, serviceId, instanceId string) *scerr.Error {
+func (c *Client) Heartbeat(ctx context.Context, domainProject, serviceID, instanceID string) *scerr.Error {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
 
 	resp, err := c.RestDoWithContext(ctx, http.MethodPut,
-		fmt.Sprintf(apiInstanceHeartbeatURL, project, serviceId, instanceId),
+		fmt.Sprintf(apiInstanceHeartbeatURL, project, serviceID, instanceID),
 		headers, nil)
 	if err != nil {
 		return scerr.NewError(scerr.ErrInternal, err.Error())
@@ -158,7 +158,7 @@ func (c *SCClient) Heartbeat(ctx context.Context, domainProject, serviceId, inst
 	return nil
 }
 
-func (c *SCClient) HeartbeatSet(ctx context.Context, domainProject string, instances ...*pb.HeartbeatSetElement) ([]*pb.InstanceHbRst, *scerr.Error) {
+func (c *Client) HeartbeatSet(ctx context.Context, domainProject string, instances ...*pb.HeartbeatSetElement) ([]*pb.InstanceHbRst, *scerr.Error) {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
@@ -194,13 +194,13 @@ func (c *SCClient) HeartbeatSet(ctx context.Context, domainProject string, insta
 	return instancesResp.Instances, nil
 }
 
-func (c *SCClient) GetInstancesByServiceId(ctx context.Context, domainProject, providerId, consumerId string) ([]*pb.MicroServiceInstance, *scerr.Error) {
+func (c *Client) GetInstancesByServiceID(ctx context.Context, domainProject, providerID, consumerID string) ([]*pb.MicroServiceInstance, *scerr.Error) {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
-	headers.Set("X-ConsumerId", consumerId)
+	headers.Set("X-ConsumerId", consumerID)
 	resp, err := c.RestDoWithContext(ctx, http.MethodGet,
-		fmt.Sprintf(apiInstancesURL, project, providerId)+"?"+c.parseQuery(ctx),
+		fmt.Sprintf(apiInstancesURL, project, providerID)+"?"+c.parseQuery(ctx),
 		headers, nil)
 	if err != nil {
 		return nil, scerr.NewError(scerr.ErrInternal, err.Error())
@@ -225,13 +225,13 @@ func (c *SCClient) GetInstancesByServiceId(ctx context.Context, domainProject, p
 	return instancesResp.Instances, nil
 }
 
-func (c *SCClient) GetInstanceByInstanceId(ctx context.Context, domainProject, providerId, instanceId, consumerId string) (*pb.MicroServiceInstance, *scerr.Error) {
+func (c *Client) GetInstanceByInstanceID(ctx context.Context, domainProject, providerID, instanceID, consumerID string) (*pb.MicroServiceInstance, *scerr.Error) {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
-	headers.Set("X-ConsumerId", consumerId)
+	headers.Set("X-ConsumerId", consumerID)
 	resp, err := c.RestDoWithContext(ctx, http.MethodGet,
-		fmt.Sprintf(apiInstanceURL, project, providerId, instanceId)+"?"+c.parseQuery(ctx),
+		fmt.Sprintf(apiInstanceURL, project, providerID, instanceID)+"?"+c.parseQuery(ctx),
 		headers, nil)
 	if err != nil {
 		return nil, scerr.NewError(scerr.ErrInternal, err.Error())
diff --git a/pkg/client/sc/microservice.go b/pkg/client/sc/microservice.go
index f791bc3..161357a 100644
--- a/pkg/client/sc/microservice.go
+++ b/pkg/client/sc/microservice.go
@@ -34,7 +34,7 @@ const (
 	apiMicroServiceURL  = "/v4/%s/registry/microservices/%s"
 )
 
-func (c *SCClient) CreateService(ctx context.Context, domainProject string, service *pb.MicroService) (string, *scerr.Error) {
+func (c *Client) CreateService(ctx context.Context, domainProject string, service *pb.MicroService) (string, *scerr.Error) {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
@@ -69,13 +69,13 @@ func (c *SCClient) CreateService(ctx context.Context, domainProject string, serv
 	return serviceResp.ServiceId, nil
 }
 
-func (c *SCClient) DeleteService(ctx context.Context, domainProject, serviceId string) *scerr.Error {
+func (c *Client) DeleteService(ctx context.Context, domainProject, serviceID string) *scerr.Error {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
 
 	resp, err := c.RestDoWithContext(ctx, http.MethodDelete,
-		fmt.Sprintf(apiMicroServiceURL, project, serviceId),
+		fmt.Sprintf(apiMicroServiceURL, project, serviceID),
 		headers, nil)
 	if err != nil {
 		return scerr.NewError(scerr.ErrInternal, err.Error())
@@ -94,11 +94,11 @@ func (c *SCClient) DeleteService(ctx context.Context, domainProject, serviceId s
 	return nil
 }
 
-func (c *SCClient) ServiceExistence(ctx context.Context, domainProject string, appId, serviceName, versionRule, env string) (string, *scerr.Error) {
+func (c *Client) ServiceExistence(ctx context.Context, domainProject string, appID, serviceName, versionRule, env string) (string, *scerr.Error) {
 	query := url.Values{}
 	query.Set("type", "microservice")
 	query.Set("env", env)
-	query.Set("appId", appId)
+	query.Set("appID", appID)
 	query.Set("serviceName", serviceName)
 	query.Set("version", versionRule)
 
@@ -110,7 +110,7 @@ func (c *SCClient) ServiceExistence(ctx context.Context, domainProject string, a
 	return resp.ServiceId, nil
 }
 
-func (c *SCClient) existence(ctx context.Context, domainProject string, query url.Values) (*pb.GetExistenceResponse, *scerr.Error) {
+func (c *Client) existence(ctx context.Context, domainProject string, query url.Values) (*pb.GetExistenceResponse, *scerr.Error) {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
diff --git a/pkg/client/sc/schema.go b/pkg/client/sc/schema.go
index f1b9d42..2a9bdc8 100644
--- a/pkg/client/sc/schema.go
+++ b/pkg/client/sc/schema.go
@@ -35,7 +35,7 @@ const (
 	apiSchemaURL  = "/v4/%s/registry/microservices/%s/schemas/%s"
 )
 
-func (c *SCClient) CreateSchemas(ctx context.Context, domainProject, serviceId string, schemas []*pb.Schema) *scerr.Error {
+func (c *Client) CreateSchemas(ctx context.Context, domainProject, serviceID string, schemas []*pb.Schema) *scerr.Error {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
@@ -46,13 +46,13 @@ func (c *SCClient) CreateSchemas(ctx context.Context, domainProject, serviceId s
 		}
 	}
 
-	reqBody, err := json.Marshal(&pb.ModifySchemasRequest{ServiceId: serviceId, Schemas: schemas})
+	reqBody, err := json.Marshal(&pb.ModifySchemasRequest{ServiceId: serviceID, Schemas: schemas})
 	if err != nil {
 		return scerr.NewError(scerr.ErrInternal, err.Error())
 	}
 
 	resp, err := c.RestDoWithContext(ctx, http.MethodPost,
-		fmt.Sprintf(apiSchemasURL, project, serviceId),
+		fmt.Sprintf(apiSchemasURL, project, serviceID),
 		headers, reqBody)
 	if err != nil {
 		return scerr.NewError(scerr.ErrInternal, err.Error())
@@ -70,14 +70,14 @@ func (c *SCClient) CreateSchemas(ctx context.Context, domainProject, serviceId s
 	return nil
 }
 
-func (c *SCClient) UpdateSchema(ctx context.Context, domainProject, serviceId string, schemaId string, schema string) *scerr.Error {
+func (c *Client) UpdateSchema(ctx context.Context, domainProject, serviceID string, schemaID string, schema string) *scerr.Error {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
 
 	reqBody, err := json.Marshal(&pb.ModifySchemaRequest{
-		ServiceId: serviceId,
-		SchemaId:  schemaId,
+		ServiceId: serviceID,
+		SchemaId:  schemaID,
 		Schema:    schema,
 		Summary:   schemaSummary(schema),
 	})
@@ -86,7 +86,7 @@ func (c *SCClient) UpdateSchema(ctx context.Context, domainProject, serviceId st
 	}
 
 	resp, err := c.RestDoWithContext(ctx, http.MethodPut,
-		fmt.Sprintf(apiSchemaURL, project, serviceId, schemaId),
+		fmt.Sprintf(apiSchemaURL, project, serviceID, schemaID),
 		headers, reqBody)
 	if err != nil {
 		return scerr.NewError(scerr.ErrInternal, err.Error())
@@ -104,18 +104,18 @@ func (c *SCClient) UpdateSchema(ctx context.Context, domainProject, serviceId st
 	return nil
 }
 
-func (c *SCClient) DeleteSchema(ctx context.Context, domainProject, serviceId string, schemaId string) *scerr.Error {
+func (c *Client) DeleteSchema(ctx context.Context, domainProject, serviceID string, schemaID string) *scerr.Error {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
 
-	reqBody, err := json.Marshal(&pb.DeleteSchemaRequest{ServiceId: serviceId, SchemaId: schemaId})
+	reqBody, err := json.Marshal(&pb.DeleteSchemaRequest{ServiceId: serviceID, SchemaId: schemaID})
 	if err != nil {
 		return scerr.NewError(scerr.ErrInternal, err.Error())
 	}
 
 	resp, err := c.RestDoWithContext(ctx, http.MethodDelete,
-		fmt.Sprintf(apiSchemaURL, project, serviceId, schemaId),
+		fmt.Sprintf(apiSchemaURL, project, serviceID, schemaID),
 		headers, reqBody)
 	if err != nil {
 		return scerr.NewError(scerr.ErrInternal, err.Error())
@@ -133,12 +133,12 @@ func (c *SCClient) DeleteSchema(ctx context.Context, domainProject, serviceId st
 	return nil
 }
 
-func (c *SCClient) GetSchemasByServiceId(ctx context.Context, domainProject, serviceId string) ([]*pb.Schema, *scerr.Error) {
+func (c *Client) GetSchemasByServiceID(ctx context.Context, domainProject, serviceID string) ([]*pb.Schema, *scerr.Error) {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
 	resp, err := c.RestDoWithContext(ctx, http.MethodGet,
-		fmt.Sprintf(apiSchemasURL, project, serviceId)+"?withSchema=1&"+c.parseQuery(ctx),
+		fmt.Sprintf(apiSchemasURL, project, serviceID)+"?withSchema=1&"+c.parseQuery(ctx),
 		headers, nil)
 	if err != nil {
 		return nil, scerr.NewError(scerr.ErrInternal, err.Error())
@@ -163,12 +163,12 @@ func (c *SCClient) GetSchemasByServiceId(ctx context.Context, domainProject, ser
 	return schemas.Schemas, nil
 }
 
-func (c *SCClient) GetSchemaBySchemaId(ctx context.Context, domainProject, serviceId, schemaId string) (*pb.Schema, *scerr.Error) {
+func (c *Client) GetSchemaBySchemaID(ctx context.Context, domainProject, serviceID, schemaID string) (*pb.Schema, *scerr.Error) {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
 	resp, err := c.RestDoWithContext(ctx, http.MethodGet,
-		fmt.Sprintf(apiSchemaURL, project, serviceId, schemaId)+"?"+c.parseQuery(ctx),
+		fmt.Sprintf(apiSchemaURL, project, serviceID, schemaID)+"?"+c.parseQuery(ctx),
 		headers, nil)
 	if err != nil {
 		return nil, scerr.NewError(scerr.ErrInternal, err.Error())
@@ -191,7 +191,7 @@ func (c *SCClient) GetSchemaBySchemaId(ctx context.Context, domainProject, servi
 	}
 
 	return &pb.Schema{
-		SchemaId: schemaId,
+		SchemaId: schemaID,
 		Schema:   schema.Schema,
 		Summary:  schema.SchemaSummary,
 	}, nil
diff --git a/pkg/client/sc/watch.go b/pkg/client/sc/watch.go
index 3b74fa5..0efad41 100644
--- a/pkg/client/sc/watch.go
+++ b/pkg/client/sc/watch.go
@@ -28,16 +28,15 @@ import (
 )
 
 const (
-	apiWatcherURL        = "/v4/%s/registry/microservices/%s/watcher"
-	apiListAndWatcherURL = "/v4/%s/registry/microservices/%s/listwatcher"
+	apiWatcherURL = "/v4/%s/registry/microservices/%s/watcher"
 )
 
-func (c *SCClient) Watch(ctx context.Context, domainProject, selfServiceId string, callback func(*pb.WatchInstanceResponse)) *scerr.Error {
+func (c *Client) Watch(ctx context.Context, domainProject, selfServiceID string, callback func(*pb.WatchInstanceResponse)) *scerr.Error {
 	domain, project := core.FromDomainProject(domainProject)
 	headers := c.CommonHeaders(ctx)
 	headers.Set("X-Domain-Name", domain)
 
-	conn, err := c.WebsocketDial(ctx, fmt.Sprintf(apiWatcherURL, project, selfServiceId), headers)
+	conn, err := c.WebsocketDial(ctx, fmt.Sprintf(apiWatcherURL, project, selfServiceID), headers)
 	if err != nil {
 		return scerr.NewError(scerr.ErrInternal, err.Error())
 	}
diff --git a/pkg/errors/error.go b/pkg/errors/error.go
index ee39a51..818b8bb 100644
--- a/pkg/errors/error.go
+++ b/pkg/errors/error.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package errors
 
 import (
diff --git a/pkg/etcdsync/mutex.go b/pkg/etcdsync/mutex.go
index 5477ced..266ed2a 100644
--- a/pkg/etcdsync/mutex.go
+++ b/pkg/etcdsync/mutex.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package etcdsync
 
 import (
@@ -31,9 +32,9 @@ import (
 )
 
 const (
-	DEFAULT_LOCK_TTL    = 60
-	DEFAULT_RETRY_TIMES = 3
-	ROOT_PATH           = "/cse/etcdsync"
+	DefaultLockTTL    = 60
+	DefaultRetryTimes = 3
+	RootPath          = "/cse/etcdsync"
 
 	OperationGlobalLock = "GLOBAL_LOCK"
 )
@@ -48,11 +49,9 @@ type DLock struct {
 }
 
 var (
-	globalMux sync.Mutex
-	IsDebug   bool
-	hostname  = util.HostName()
-	pid       = os.Getpid()
-	mutex     = new(sync.Mutex)
+	IsDebug  bool
+	hostname = util.HostName()
+	pid      = os.Getpid()
 )
 
 func NewDLock(key string, ttl int64, wait bool) (l *DLock, err error) {
@@ -60,7 +59,7 @@ func NewDLock(key string, ttl int64, wait bool) (l *DLock, err error) {
 		return nil, nil
 	}
 	if ttl < 1 {
-		ttl = DEFAULT_LOCK_TTL
+		ttl = DefaultLockTTL
 	}
 
 	now := time.Now()
@@ -72,7 +71,7 @@ func NewDLock(key string, ttl int64, wait bool) (l *DLock, err error) {
 		createAt: now,
 		mutex:    &sync.Mutex{},
 	}
-	for try := 1; try <= DEFAULT_RETRY_TIMES; try++ {
+	for try := 1; try <= DefaultRetryTimes; try++ {
 		err = l.Lock(wait)
 		if err == nil {
 			return
@@ -119,7 +118,10 @@ func (m *DLock) Lock(wait bool) (err error) {
 	}
 
 	if leaseID > 0 {
-		backend.Registry().LeaseRevoke(m.ctx, leaseID)
+		err = backend.Registry().LeaseRevoke(m.ctx, leaseID)
+		if err != nil {
+			return err
+		}
 	}
 
 	if m.ttl == 0 || !wait {
@@ -167,7 +169,7 @@ func (m *DLock) Unlock() (err error) {
 		registry.DEL,
 		registry.WithStrKey(m.key)}
 
-	for i := 1; i <= DEFAULT_RETRY_TIMES; i++ {
+	for i := 1; i <= DefaultRetryTimes; i++ {
 		_, err = backend.Registry().Do(m.ctx, opts...)
 		if err == nil {
 			log.Infof("Delete lock OK, key=%s, id=%s", m.key, m.id)
@@ -183,5 +185,5 @@ func (m *DLock) Unlock() (err error) {
 }
 
 func Lock(key string, ttl int64, wait bool) (*DLock, error) {
-	return NewDLock(fmt.Sprintf("%s%s", ROOT_PATH, key), ttl, wait)
+	return NewDLock(fmt.Sprintf("%s%s", RootPath, key), ttl, wait)
 }
diff --git a/pkg/gopool/goroutines.go b/pkg/gopool/goroutines.go
index 9bfb15b..4e22ced 100644
--- a/pkg/gopool/goroutines.go
+++ b/pkg/gopool/goroutines.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package gopool
 
 import (
diff --git a/pkg/grace/grace.go b/pkg/grace/grace.go
index 7f26a53..ec94485 100644
--- a/pkg/grace/grace.go
+++ b/pkg/grace/grace.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package grace
 
 import (
@@ -112,25 +113,21 @@ func fireSignalHook(ppFlag int, sig os.Signal) {
 }
 
 func handleSignals() {
-	var sig os.Signal
 
-	sigCh := make(chan os.Signal)
+	sigCh := make(chan os.Signal, 1)
 	signal.Notify(sigCh, registerSignals...)
 
-	for {
-		select {
-		case sig = <-sigCh:
-			fireSignalHook(PreSignal, sig)
-			switch sig {
-			case syscall.SIGHUP:
-				log.Debugf("received signal '%v', now forking", sig)
-				err := fork()
-				if err != nil {
-					log.Errorf(err, "fork a process failed")
-				}
+	for sig := range sigCh {
+		fireSignalHook(PreSignal, sig)
+		switch sig {
+		case syscall.SIGHUP:
+			log.Debugf("received signal '%v', now forking", sig)
+			err := fork()
+			if err != nil {
+				log.Errorf(err, "fork a process failed")
 			}
-			fireSignalHook(PostSignal, sig)
 		}
+		fireSignalHook(PostSignal, sig)
 	}
 }
 
diff --git a/pkg/log/log.go b/pkg/log/log.go
index 43d0cfa..8d7e324 100644
--- a/pkg/log/log.go
+++ b/pkg/log/log.go
@@ -73,7 +73,7 @@ func runLogDirRotate(cfg Config) {
 	go func() {
 		for {
 			<-time.After(defaultLogRotatePeriod)
-			LogRotate(filepath.Dir(cfg.LoggerFile), cfg.LogRotateSize, cfg.LogBackupCount)
+			Rotate(filepath.Dir(cfg.LoggerFile), cfg.LogRotateSize, cfg.LogBackupCount)
 		}
 	}()
 }
diff --git a/pkg/log/log_test.go b/pkg/log/log_test.go
index 72eaa9c..bbbe9d8 100644
--- a/pkg/log/log_test.go
+++ b/pkg/log/log_test.go
@@ -26,7 +26,7 @@ func TestNewLogger(t *testing.T) {
 	l := NewLogger(Configure())
 	defer func() {
 		r := recover()
-		LogPanic(r)
+		Panic(r)
 		l.Recover(r, 3)
 		defer func() {
 			l.Recover(recover(), 3)
@@ -74,12 +74,12 @@ func TestNewLogger(t *testing.T) {
 	Sync()
 	l.Sync()
 
-	LogNilOrWarnf(time.Now(), "a")
-	LogNilOrWarnf(time.Now().Add(-time.Second), "a")
-	LogDebugOrWarnf(time.Now(), "a")
-	LogDebugOrWarnf(time.Now().Add(-time.Second), "a")
-	LogInfoOrWarnf(time.Now(), "a")
-	LogInfoOrWarnf(time.Now().Add(-time.Second), "a")
+	NilOrWarnf(time.Now(), "a")
+	NilOrWarnf(time.Now().Add(-time.Second), "a")
+	DebugOrWarnf(time.Now(), "a")
+	DebugOrWarnf(time.Now().Add(-time.Second), "a")
+	InfoOrWarnf(time.Now(), "a")
+	InfoOrWarnf(time.Now().Add(-time.Second), "a")
 
 	l.Fatal("a", nil)
 }
@@ -92,7 +92,7 @@ func TestNewLoggerWithEmptyConfig(t *testing.T) {
 func TestLogPanic(t *testing.T) {
 	defer func() {
 		defer func() {
-			LogPanic(recover())
+			Panic(recover())
 		}()
 		panic("bbb")
 	}()
diff --git a/pkg/log/logger.go b/pkg/log/logger.go
index f28af96..df10391 100644
--- a/pkg/log/logger.go
+++ b/pkg/log/logger.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package log
 
 import (
@@ -69,16 +70,16 @@ func Sync() {
 	logger.Sync()
 }
 
-func LogNilOrWarnf(start time.Time, format string, args ...interface{}) {
-	cost := time.Now().Sub(start)
+func NilOrWarnf(start time.Time, format string, args ...interface{}) {
+	cost := time.Since(start)
 	if cost < time.Second {
 		return
 	}
 	logger.Warnf("[%s]%s", cost, fmt.Sprintf(format, args...))
 }
 
-func LogDebugOrWarnf(start time.Time, format string, args ...interface{}) {
-	cost := time.Now().Sub(start)
+func DebugOrWarnf(start time.Time, format string, args ...interface{}) {
+	cost := time.Since(start)
 	if cost < time.Second {
 		logger.Debugf("[%s]%s", cost, fmt.Sprintf(format, args...))
 		return
@@ -86,8 +87,8 @@ func LogDebugOrWarnf(start time.Time, format string, args ...interface{}) {
 	logger.Warnf("[%s]%s", cost, fmt.Sprintf(format, args...))
 }
 
-func LogInfoOrWarnf(start time.Time, format string, args ...interface{}) {
-	cost := time.Now().Sub(start)
+func InfoOrWarnf(start time.Time, format string, args ...interface{}) {
+	cost := time.Since(start)
 	if cost < time.Second {
 		logger.Infof("[%s]%s", cost, fmt.Sprintf(format, args...))
 		return
@@ -95,16 +96,15 @@ func LogInfoOrWarnf(start time.Time, format string, args ...interface{}) {
 	logger.Warnf("[%s]%s", cost, fmt.Sprintf(format, args...))
 }
 
-// LogPanic is a function can only be called in defer function.
-func LogPanic(r interface{}) {
-	logger.Recover(r, 3) // LogPanic()<-Recover()<-panic()<-final caller
+// Panic is a function can only be called in defer function.
+func Panic(r interface{}) {
+	logger.Recover(r, 3) // Panic()<-Recover()<-panic()<-final caller
 }
 
 // Recover is a function call recover() and print the stack in log
 // Please call this function like 'defer log.Recover()' in your code
 func Recover() {
 	if r := recover(); r != nil {
-		LogPanic(r)
+		Panic(r)
 	}
-	return
 }
diff --git a/pkg/log/logrotate.go b/pkg/log/logrotate.go
index bf7e906..4c77f15 100644
--- a/pkg/log/logrotate.go
+++ b/pkg/log/logrotate.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package log
 
 import (
@@ -54,7 +55,6 @@ func removeExceededFiles(path string, baseFileName string,
 	if maxKeptCount < 0 {
 		return
 	}
-	fileList := make([]string, 0, 2*maxKeptCount)
 	var pat string
 	if rotateStage == "rollover" {
 		//rotated file, svc.log.20060102150405000
@@ -205,10 +205,10 @@ func doBackup(fPath string, MaxBackupCount int) {
 	removeExceededFiles(filepath.Dir(fPath), filepath.Base(fPath), MaxBackupCount, "backup")
 }
 
-func LogRotateFile(file string, MaxFileSize int, MaxBackupCount int) {
+func RotateFile(file string, MaxFileSize int, MaxBackupCount int) {
 	defer func() {
 		if e := recover(); e != nil {
-			Errorf(nil, "LogRotate file %s catch an exception, err: %v.", EscapPath(file), e)
+			Errorf(nil, "Rotate file %s catch an exception, err: %v.", EscapPath(file), e)
 		}
 	}()
 
@@ -219,11 +219,11 @@ func LogRotateFile(file string, MaxFileSize int, MaxBackupCount int) {
 //path:			where log files need rollover
 //MaxFileSize: 		MaxSize of a file before rotate. By M Bytes.
 //MaxBackupCount: 	Max counts to keep of a log's backup files.
-func LogRotate(path string, MaxFileSize int, MaxBackupCount int) {
+func Rotate(path string, MaxFileSize int, MaxBackupCount int) {
 	//filter .log .trace files
 	defer func() {
 		if e := recover(); e != nil {
-			Errorf(nil, "LogRotate catch an exception, err: %v.", e)
+			Errorf(nil, "Rotate catch an exception, err: %v.", e)
 		}
 	}()
 
@@ -235,7 +235,7 @@ func LogRotate(path string, MaxFileSize int, MaxBackupCount int) {
 	}
 
 	for _, file := range fileList {
-		LogRotateFile(file, MaxFileSize, MaxBackupCount)
+		RotateFile(file, MaxFileSize, MaxBackupCount)
 	}
 }
 
diff --git a/pkg/log/logrotate_test.go b/pkg/log/logrotate_test.go
index 312e518..4312646 100644
--- a/pkg/log/logrotate_test.go
+++ b/pkg/log/logrotate_test.go
@@ -27,9 +27,9 @@ func TestLogRotate(t *testing.T) {
 		t.Fatal("pathReplacer failed", s)
 	}
 
-	LogRotate("../../etc", 1, 1)
+	Rotate("../../etc", 1, 1)
 
-	LogRotateFile("../../etc/conf/app.conf", 1, 1)
+	RotateFile("../../etc/conf/app.conf", 1, 1)
 
 	if err := compressFile(
 		"../../etc/conf/app.conf",
diff --git a/pkg/log/zap.go b/pkg/log/zap.go
index 49922a2..3dd9018 100644
--- a/pkg/log/zap.go
+++ b/pkg/log/zap.go
@@ -19,6 +19,7 @@ package log
 
 import (
 	"fmt"
+	"log"
 	"os"
 	"runtime"
 	"runtime/debug"
@@ -156,7 +157,7 @@ func toZapConfig(c Config) zapcore.Core {
 		syncer = StdoutSyncer
 	}
 
-	zap.NewDevelopment()
+	//zap.NewDevelopment()
 	return zapcore.NewCore(enc, syncer, levelEnabler)
 }
 
@@ -237,19 +238,34 @@ func (l *Logger) Recover(r interface{}, callerSkip int) {
 		e.Caller.TrimmedPath(),
 		r,
 		e.Stack)
-	StderrSyncer.Sync() // sync immediately, for server may exit abnormally
+	err := StderrSyncer.Sync() // sync immediately, for server may exit abnormally
+	if err != nil {
+		log.Println(err)
+	}
 	if err := l.zapLogger.Core().With([]zap.Field{zap.Reflect("recover", r)}).Write(e, nil); err != nil {
 		fmt.Fprintf(StderrSyncer, "%s\tERROR\t%v\n", time.Now().Format("2006-01-02T15:04:05.000Z0700"), err)
 		fmt.Fprintln(StderrSyncer, util.BytesToStringWithNoCopy(debug.Stack()))
-		StderrSyncer.Sync()
+		err = StderrSyncer.Sync()
+		if err != nil {
+			log.Println(err)
+		}
 		return
 	}
 }
 
 func (l *Logger) Sync() {
-	l.zapLogger.Sync()
-	StderrSyncer.Sync()
-	StdoutSyncer.Sync()
+	err := l.zapLogger.Sync()
+	if err != nil {
+		log.Println(err)
+	}
+	err = StderrSyncer.Sync()
+	if err != nil {
+		log.Println(err)
+	}
+	err = StdoutSyncer.Sync()
+	if err != nil {
+		log.Println(err)
+	}
 }
 
 func NewLogger(cfg Config) *Logger {
diff --git a/server/admin/model/dump.go b/pkg/model/dump.go
similarity index 95%
rename from server/admin/model/dump.go
rename to pkg/model/dump.go
index aea1e2f..96fe89b 100644
--- a/server/admin/model/dump.go
+++ b/pkg/model/dump.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package model
 
 import (
@@ -216,9 +217,9 @@ type DumpRequest struct {
 }
 
 type DumpResponse struct {
-	Response     *pb.Response        `json:"response,omitempty"`
-	Info         *version.VersionSet `json:"info,omitempty"`
-	AppConfig    map[string]string   `json:"appConf,omitempty"`
-	Environments map[string]string   `json:"environments,omitempty"`
-	Cache        *Cache              `json:"cache,omitempty"`
+	Response     *pb.Response      `json:"response,omitempty"`
+	Info         *version.Set      `json:"info,omitempty"`
+	AppConfig    map[string]string `json:"appConf,omitempty"`
+	Environments map[string]string `json:"environments,omitempty"`
+	Cache        *Cache            `json:"cache,omitempty"`
 }
diff --git a/server/admin/model/types.go b/pkg/model/types.go
similarity index 100%
rename from server/admin/model/types.go
rename to pkg/model/types.go
diff --git a/pkg/notify/common.go b/pkg/notify/common.go
index 5217aab..c98e31c 100644
--- a/pkg/notify/common.go
+++ b/pkg/notify/common.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package notify
 
 const (
diff --git a/pkg/notify/group.go b/pkg/notify/group.go
index 58f39a0..c600bba 100644
--- a/pkg/notify/group.go
+++ b/pkg/notify/group.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package notify
 
 import (
@@ -45,7 +46,7 @@ func (g *Group) Subscribers(name string) Subscriber {
 }
 
 func (g *Group) AddSubscriber(subscriber Subscriber) Subscriber {
-	return g.subscribers.PutIfAbsent(subscriber.Id(), subscriber).(Subscriber)
+	return g.subscribers.PutIfAbsent(subscriber.ID(), subscriber).(Subscriber)
 }
 
 func (g *Group) Remove(name string) {
diff --git a/pkg/notify/group_test.go b/pkg/notify/group_test.go
index 44b185d..81040a7 100644
--- a/pkg/notify/group_test.go
+++ b/pkg/notify/group_test.go
@@ -47,11 +47,11 @@ func TestGroup_Add(t *testing.T) {
 	if g.Size() != 2 {
 		t.Fatalf("TestGroup_Add failed")
 	}
-	g.Remove(m.Id())
+	g.Remove(m.ID())
 	if g.Size() != 1 {
 		t.Fatalf("TestGroup_Add failed")
 	}
-	if g.Subscribers(m.Id()) == m {
+	if g.Subscribers(m.ID()) == m {
 		t.Fatalf("TestGroup_Add failed")
 	}
 
@@ -59,7 +59,7 @@ func TestGroup_Add(t *testing.T) {
 	if g.AddSubscriber(mock) != mock {
 		t.Fatalf("TestGroup_Add failed")
 	}
-	if g.Subscribers(mock.Id()) != mock {
+	if g.Subscribers(mock.ID()) != mock {
 		t.Fatalf("TestGroup_Add failed")
 	}
 	job := &baseEvent{nType: INSTANCE}
diff --git a/pkg/notify/notice.go b/pkg/notify/notice.go
index cc3b272..8015d7d 100644
--- a/pkg/notify/notice.go
+++ b/pkg/notify/notice.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package notify
 
 import (
diff --git a/pkg/notify/notification_healthchecker.go b/pkg/notify/notification_healthchecker.go
index 8cc41cd..2466d8c 100644
--- a/pkg/notify/notification_healthchecker.go
+++ b/pkg/notify/notification_healthchecker.go
@@ -14,27 +14,28 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package notify
 
 import "github.com/apache/servicecomb-service-center/pkg/log"
 
 const (
-	NOTIFY_SERVER_CHECKER_NAME  = "__HealthChecker__"
-	NOTIFY_SERVER_CHECK_SUBJECT = "__NotifyServerHealthCheck__"
+	ServerCheckerName  = "__HealthChecker__"
+	ServerCheckSubject = "__NotifyServerHealthCheck__"
 )
 
 //Notifier 健康检查
-type NotifyServiceHealthChecker struct {
+type ServiceHealthChecker struct {
 	Subscriber
 }
 
-type NotifyServiceHealthCheckJob struct {
+type ServiceHealthCheckJob struct {
 	Event
 	ErrorSubscriber Subscriber
 }
 
-func (s *NotifyServiceHealthChecker) OnMessage(job Event) {
-	j := job.(*NotifyServiceHealthCheckJob)
+func (s *ServiceHealthChecker) OnMessage(job Event) {
+	j := job.(*ServiceHealthCheckJob)
 	err := j.ErrorSubscriber.Err()
 
 	if j.ErrorSubscriber.Type() == NOTIFTY {
@@ -48,15 +49,15 @@ func (s *NotifyServiceHealthChecker) OnMessage(job Event) {
 	s.Service().RemoveSubscriber(j.ErrorSubscriber)
 }
 
-func NewNotifyServiceHealthChecker() *NotifyServiceHealthChecker {
-	return &NotifyServiceHealthChecker{
-		Subscriber: NewSubscriber(NOTIFTY, NOTIFY_SERVER_CHECK_SUBJECT, NOTIFY_SERVER_CHECKER_NAME),
+func NewNotifyServiceHealthChecker() *ServiceHealthChecker {
+	return &ServiceHealthChecker{
+		Subscriber: NewSubscriber(NOTIFTY, ServerCheckSubject, ServerCheckerName),
 	}
 }
 
-func NewNotifyServiceHealthCheckJob(s Subscriber) *NotifyServiceHealthCheckJob {
-	return &NotifyServiceHealthCheckJob{
-		Event:           NewEvent(NOTIFTY, NOTIFY_SERVER_CHECK_SUBJECT, NOTIFY_SERVER_CHECKER_NAME),
+func NewNotifyServiceHealthCheckJob(s Subscriber) *ServiceHealthCheckJob {
+	return &ServiceHealthCheckJob{
+		Event:           NewEvent(NOTIFTY, ServerCheckSubject, ServerCheckerName),
 		ErrorSubscriber: s,
 	}
 }
diff --git a/pkg/notify/notification_service.go b/pkg/notify/notification_service.go
index 7eebc6a..445e428 100644
--- a/pkg/notify/notification_service.go
+++ b/pkg/notify/notification_service.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package notify
 
 import (
@@ -22,13 +23,13 @@ import (
 	"sync"
 )
 
-type NotifyService struct {
+type Service struct {
 	processors map[Type]*Processor
 	mux        sync.RWMutex
 	isClose    bool
 }
 
-func (s *NotifyService) newProcessor(t Type) *Processor {
+func (s *Service) newProcessor(t Type) *Processor {
 	s.mux.RLock()
 	p, ok := s.processors[t]
 	if ok {
@@ -51,7 +52,7 @@ func (s *NotifyService) newProcessor(t Type) *Processor {
 	return p
 }
 
-func (s *NotifyService) Start() {
+func (s *Service) Start() {
 	if !s.Closed() {
 		log.Warnf("notify service is already running")
 		return
@@ -61,12 +62,15 @@ func (s *NotifyService) Start() {
 	s.mux.Unlock()
 
 	// 错误subscriber清理
-	s.AddSubscriber(NewNotifyServiceHealthChecker())
+	err := s.AddSubscriber(NewNotifyServiceHealthChecker())
+	if err != nil {
+		log.Error("", err)
+	}
 
 	log.Debugf("notify service is started")
 }
 
-func (s *NotifyService) AddSubscriber(n Subscriber) error {
+func (s *Service) AddSubscriber(n Subscriber) error {
 	if n == nil {
 		err := errors.New("required Subscriber")
 		log.Errorf(err, "add subscriber failed")
@@ -87,7 +91,7 @@ func (s *NotifyService) AddSubscriber(n Subscriber) error {
 	return nil
 }
 
-func (s *NotifyService) RemoveSubscriber(n Subscriber) {
+func (s *Service) RemoveSubscriber(n Subscriber) {
 	s.mux.RLock()
 	p, ok := s.processors[n.Type()]
 	if !ok {
@@ -100,7 +104,7 @@ func (s *NotifyService) RemoveSubscriber(n Subscriber) {
 	n.Close()
 }
 
-func (s *NotifyService) stopProcessors() {
+func (s *Service) stopProcessors() {
 	s.mux.RLock()
 	for _, p := range s.processors {
 		p.Clear()
@@ -110,7 +114,7 @@ func (s *NotifyService) stopProcessors() {
 }
 
 //通知内容塞到队列里
-func (s *NotifyService) Publish(job Event) error {
+func (s *Service) Publish(job Event) error {
 	if s.Closed() {
 		return errors.New("add notify job failed for server shutdown")
 	}
@@ -126,14 +130,14 @@ func (s *NotifyService) Publish(job Event) error {
 	return nil
 }
 
-func (s *NotifyService) Closed() (b bool) {
+func (s *Service) Closed() (b bool) {
 	s.mux.RLock()
 	b = s.isClose
 	s.mux.RUnlock()
 	return
 }
 
-func (s *NotifyService) Stop() {
+func (s *Service) Stop() {
 	if s.Closed() {
 		return
 	}
@@ -146,8 +150,8 @@ func (s *NotifyService) Stop() {
 	log.Debug("notify service stopped")
 }
 
-func NewNotifyService() *NotifyService {
-	return &NotifyService{
+func NewNotifyService() *Service {
+	return &Service{
 		processors: make(map[Type]*Processor),
 		isClose:    true,
 	}
diff --git a/pkg/notify/notification_test.go b/pkg/notify/notification_test.go
index c1b3c5d..f2af609 100644
--- a/pkg/notify/notification_test.go
+++ b/pkg/notify/notification_test.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package notify
 
 import (
diff --git a/pkg/notify/processor.go b/pkg/notify/processor.go
index 73f2e70..5b24885 100644
--- a/pkg/notify/processor.go
+++ b/pkg/notify/processor.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package notify
 
 import (
@@ -27,7 +28,6 @@ type Processor struct {
 
 	name     string
 	subjects *util.ConcurrentMap
-	queue    chan Event
 }
 
 func (p *Processor) Name() string {
@@ -75,7 +75,7 @@ func (p *Processor) Remove(n Subscriber) {
 		return
 	}
 
-	g.Remove(n.Id())
+	g.Remove(n.ID())
 
 	if g.Size() == 0 {
 		s.Remove(g.Name())
diff --git a/pkg/notify/processor_test.go b/pkg/notify/processor_test.go
index 3505457..894231b 100644
--- a/pkg/notify/processor_test.go
+++ b/pkg/notify/processor_test.go
@@ -45,7 +45,7 @@ func TestProcessor_Do(t *testing.T) {
 		t.Fatalf("TestProcessor_Do")
 	}
 	p.AddSubscriber(mock1)
-	if p.Subjects(mock1.Subject()).Groups(mock1.Group()).Subscribers(mock1.Id()) != mock1 {
+	if p.Subjects(mock1.Subject()).Groups(mock1.Group()).Subscribers(mock1.ID()) != mock1 {
 		t.Fatalf("TestProcessor_Do")
 	}
 	p.Remove(NewSubscriber(INSTANCE, "s2", "g1"))
diff --git a/pkg/notify/subject.go b/pkg/notify/subject.go
index f052801..4f79ba9 100644
--- a/pkg/notify/subject.go
+++ b/pkg/notify/subject.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package notify
 
 import (
diff --git a/pkg/notify/subscriber.go b/pkg/notify/subscriber.go
index 23d848c..85eabcd 100644
--- a/pkg/notify/subscriber.go
+++ b/pkg/notify/subscriber.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package notify
 
 import (
@@ -22,12 +23,12 @@ import (
 )
 
 type Subscriber interface {
-	Id() string
+	ID() string
 	Subject() string
 	Group() string
 	Type() Type
-	Service() *NotifyService
-	SetService(*NotifyService)
+	Service() *Service
+	SetService(*Service)
 
 	Err() error
 	SetError(err error)
@@ -43,27 +44,27 @@ type baseSubscriber struct {
 	id      string
 	subject string
 	group   string
-	service *NotifyService
+	service *Service
 	err     error
 }
 
-func (s *baseSubscriber) Id() string                    { return s.id }
-func (s *baseSubscriber) Subject() string               { return s.subject }
-func (s *baseSubscriber) Group() string                 { return s.group }
-func (s *baseSubscriber) Type() Type                    { return s.nType }
-func (s *baseSubscriber) Service() *NotifyService       { return s.service }
-func (s *baseSubscriber) SetService(svc *NotifyService) { s.service = svc }
-func (s *baseSubscriber) Err() error                    { return s.err }
-func (s *baseSubscriber) SetError(err error)            { s.err = err }
-func (s *baseSubscriber) Close()                        {}
-func (s *baseSubscriber) OnAccept()                     {}
+func (s *baseSubscriber) ID() string              { return s.id }
+func (s *baseSubscriber) Subject() string         { return s.subject }
+func (s *baseSubscriber) Group() string           { return s.group }
+func (s *baseSubscriber) Type() Type              { return s.nType }
+func (s *baseSubscriber) Service() *Service       { return s.service }
+func (s *baseSubscriber) SetService(svc *Service) { s.service = svc }
+func (s *baseSubscriber) Err() error              { return s.err }
+func (s *baseSubscriber) SetError(err error)      { s.err = err }
+func (s *baseSubscriber) Close()                  {}
+func (s *baseSubscriber) OnAccept()               {}
 func (s *baseSubscriber) OnMessage(job Event) {
 	s.SetError(errors.New("do not call base notifier OnMessage method"))
 }
 
 func NewSubscriber(nType Type, subject, group string) Subscriber {
 	return &baseSubscriber{
-		id:      util.GenerateUuid(),
+		id:      util.GenerateUUID(),
 		group:   group,
 		subject: subject,
 		nType:   nType,
diff --git a/pkg/plugin/loader.go b/pkg/plugin/loader.go
index 5a0fcf3..25d6761 100644
--- a/pkg/plugin/loader.go
+++ b/pkg/plugin/loader.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package plugin
 
 import (
@@ -130,15 +131,15 @@ func SetPluginDir(dir string) {
 	loader.Dir = dir
 }
 
-func PluginLoader() *Loader {
+func GetLoader() *Loader {
 	once.Do(loader.Init)
 	return &loader
 }
 
 func Reload() error {
-	return PluginLoader().ReloadPlugins()
+	return GetLoader().ReloadPlugins()
 }
 
 func FindFunc(pluginName, funcName string) (plugin.Symbol, error) {
-	return PluginLoader().Find(pluginName, funcName)
+	return GetLoader().Find(pluginName, funcName)
 }
diff --git a/pkg/plugin/loader_test.go b/pkg/plugin/loader_test.go
index a753ecc..5fca70c 100644
--- a/pkg/plugin/loader_test.go
+++ b/pkg/plugin/loader_test.go
@@ -75,7 +75,7 @@ func TestSetPluginDir(t *testing.T) {
 }
 
 func TestPluginLoader(t *testing.T) {
-	loader := PluginLoader()
+	loader := GetLoader()
 	if loader == nil {
 		t.Fatalf(`TestPluginLoader failed`)
 	}
diff --git a/pkg/queue/uniqueue.go b/pkg/queue/uniqueue.go
index d132ebb..98d0717 100644
--- a/pkg/queue/uniqueue.go
+++ b/pkg/queue/uniqueue.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package queue
 
 import (
@@ -42,7 +43,7 @@ func (uq *UniQueue) Chan() <-chan interface{} {
 func (uq *UniQueue) Put(value interface{}) (e error) {
 	defer func() {
 		if r := recover(); r != nil {
-			log.LogPanic(r)
+			log.Panic(r)
 
 			e = fmt.Errorf("%v", r)
 		}
diff --git a/pkg/queue/uniqueue_test.go b/pkg/queue/uniqueue_test.go
index 7d04ce4..287a862 100644
--- a/pkg/queue/uniqueue_test.go
+++ b/pkg/queue/uniqueue_test.go
@@ -55,7 +55,7 @@ func TestUniQueue_Get(t *testing.T) {
 	ctx, _ := context.WithTimeout(context.Background(), time.Second)
 	start := time.Now()
 	item := uq.Get(ctx)
-	if time.Now().Sub(start) < time.Second || item != nil {
+	if time.Since(start) < time.Second || item != nil {
 		t.Fatalf("Get should be timed out, result: %v", item)
 	}
 
diff --git a/pkg/rest/client.go b/pkg/rest/client.go
index 51a900c..a298730 100644
--- a/pkg/rest/client.go
+++ b/pkg/rest/client.go
@@ -19,8 +19,8 @@ import (
 	"bytes"
 	"compress/gzip"
 	"crypto/tls"
-	"errors"
 	"fmt"
+	"github.com/apache/servicecomb-service-center/pkg/log"
 	"io"
 	"io/ioutil"
 	"net/http"
@@ -44,7 +44,7 @@ var defaultURLClientOption = URLClientOption{
 	HandshakeTimeout:      10 * time.Second,
 	ResponseHeaderTimeout: 30 * time.Second,
 	RequestTimeout:        60 * time.Second,
-	ConnsPerHost:          DEFAULT_CONN_POOL_PER_HOST_SIZE,
+	ConnsPerHost:          DefaultConnPoolPerHostSize,
 }
 
 type URLClientOption struct {
@@ -88,7 +88,7 @@ type URLClient struct {
 	Cfg URLClientOption
 }
 
-func (client *URLClient) HttpDoWithContext(ctx context.Context, method string, rawURL string, headers http.Header, body []byte) (resp *http.Response, err error) {
+func (client *URLClient) HTTPDoWithContext(ctx context.Context, method string, rawURL string, headers http.Header, body []byte) (resp *http.Response, err error) {
 	if strings.HasPrefix(rawURL, "https") {
 		if transport, ok := client.Client.Transport.(*http.Transport); ok {
 			transport.TLSClientConfig = client.TLS
@@ -99,23 +99,23 @@ func (client *URLClient) HttpDoWithContext(ctx context.Context, method string, r
 		headers = make(http.Header)
 	}
 
-	if _, ok := headers[HEADER_HOST]; !ok {
+	if _, ok := headers[HeaderHost]; !ok {
 		parsedURL, err := url.Parse(rawURL)
 		if err != nil {
 			return nil, err
 		}
-		headers.Set(HEADER_HOST, parsedURL.Host)
+		headers.Set(HeaderHost, parsedURL.Host)
 	}
-	if _, ok := headers[HEADER_ACCEPT]; !ok {
-		headers.Set(HEADER_ACCEPT, ACCEPT_ANY)
+	if _, ok := headers[HeaderAccept]; !ok {
+		headers.Set(HeaderAccept, AcceptAny)
 	}
-	if _, ok := headers[HEADER_ACCEPT_ENCODING]; !ok && client.Cfg.Compressed {
-		headers.Set(HEADER_ACCEPT_ENCODING, "deflate, gzip")
+	if _, ok := headers[HeaderAcceptEncoding]; !ok && client.Cfg.Compressed {
+		headers.Set(HeaderAcceptEncoding, "deflate, gzip")
 	}
 
 	req, err := http.NewRequest(method, rawURL, bytes.NewBuffer(body))
 	if err != nil {
-		return nil, errors.New(fmt.Sprintf("create request failed: %s", err.Error()))
+		return nil, fmt.Errorf("create request failed: %s", err.Error())
 	}
 	req = req.WithContext(ctx)
 	req.Header = headers
@@ -126,14 +126,18 @@ func (client *URLClient) HttpDoWithContext(ctx context.Context, method string, r
 	if err != nil {
 		return nil, err
 	}
-
 	DumpResponse(resp)
 
-	switch resp.Header.Get(HEADER_CONTENT_ENCODING) {
+	switch resp.Header.Get(HeaderContentEncoding) {
 	case "gzip":
 		reader, err := NewGZipBodyReader(resp.Body)
 		if err != nil {
-			io.Copy(ioutil.Discard, resp.Body)
+			_, err = io.Copy(ioutil.Discard, resp.Body)
+			if err != nil {
+				log.Error("", err)
+				resp.Body.Close()
+				return nil, err
+			}
 			resp.Body.Close()
 			return nil, err
 		}
@@ -150,10 +154,13 @@ func DumpRequestOut(req *http.Request) {
 
 	fmt.Println(">", req.URL.String())
 	b, _ := httputil.DumpRequestOut(req, true)
-	buffer.ReadLine(bytes.NewBuffer(b), func(line string) bool {
+	err := buffer.ReadLine(bytes.NewBuffer(b), func(line string) bool {
 		fmt.Println(">", line)
 		return true
 	})
+	if err != nil {
+		log.Error("", err)
+	}
 }
 
 func DumpResponse(resp *http.Response) {
@@ -162,14 +169,17 @@ func DumpResponse(resp *http.Response) {
 	}
 
 	b, _ := httputil.DumpResponse(resp, true)
-	buffer.ReadLine(bytes.NewBuffer(b), func(line string) bool {
+	err := buffer.ReadLine(bytes.NewBuffer(b), func(line string) bool {
 		fmt.Println("<", line)
 		return true
 	})
+	if err != nil {
+		log.Error("", err)
+	}
 }
 
-func (client *URLClient) HttpDo(method string, rawURL string, headers http.Header, body []byte) (resp *http.Response, err error) {
-	return client.HttpDoWithContext(context.Background(), method, rawURL, headers, body)
+func (client *URLClient) HTTPDo(method string, rawURL string, headers http.Header, body []byte) (resp *http.Response, err error) {
+	return client.HTTPDoWithContext(context.Background(), method, rawURL, headers, body)
 }
 
 func DefaultURLClientOption() URLClientOption {
diff --git a/pkg/rest/common.go b/pkg/rest/common.go
index a1936e3..0e364e8 100644
--- a/pkg/rest/common.go
+++ b/pkg/rest/common.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package rest
 
 import (
@@ -21,37 +22,34 @@ import (
 )
 
 const (
-	HTTP_METHOD_GET    = http.MethodGet
-	HTTP_METHOD_PUT    = http.MethodPut
-	HTTP_METHOD_POST   = http.MethodPost
-	HTTP_METHOD_DELETE = http.MethodDelete
+	HTTPMethodGet    = http.MethodGet
+	HTTPMethodPut    = http.MethodPut
+	HTTPMethodPost   = http.MethodPost
+	HTTPMethodDelete = http.MethodDelete
 
-	CTX_RESPONSE      = "_server_response"
-	CTX_REQUEST       = "_server_request"
-	CTX_MATCH_PATTERN = "_server_match_pattern"
-	CTX_MATCH_FUNC    = "_server_match_func"
+	CtxResponse     = "_server_response"
+	CtxRequest      = "_server_request"
+	CtxMatchPattern = "_server_match_pattern"
+	CtxMatchFunc    = "_server_match_func"
 
 	ServerChainName = "_server_chain"
 
-	HEADER_RESPONSE_STATUS = "X-Response-Status"
-
-	HEADER_ALLOW            = "Allow"
-	HEADER_HOST             = "Host"
-	HEADER_SERVER           = "Server"
-	HEADER_CONTENT_TYPE     = "Content-Type"
-	HEADER_CONTENT_ENCODING = "Content-Encoding"
-	HEADER_ACCEPT           = "Accept"
-	HEADER_ACCEPT_ENCODING  = "Accept-Encoding"
+	HeaderResponseStatus = "X-Response-Status"
 
-	ACCEPT_ANY  = "*/*"
-	ACCEPT_JSON = "application/json"
+	HeaderAllow           = "Allow"
+	HeaderHost            = "Host"
+	HeaderServer          = "Server"
+	HeaderContentType     = "Content-Type"
+	HeaderContentEncoding = "Content-Encoding"
+	HeaderAccept          = "Accept"
+	HeaderAcceptEncoding  = "Accept-Encoding"
 
-	CONTENT_TYPE_JSON = "application/json; charset=UTF-8"
-	CONTENT_TYPE_TEXT = "text/plain; charset=UTF-8"
+	AcceptAny = "*/*"
 
-	ENCODING_GZIP = "gzip"
+	ContentTypeJSON = "application/json; charset=UTF-8"
+	ContentTypeText = "text/plain; charset=UTF-8"
 
-	DEFAULT_CONN_POOL_PER_HOST_SIZE = 5
+	DefaultConnPoolPerHostSize = 5
 )
 
 func isValidMethod(method string) bool {
diff --git a/pkg/rest/conn.go b/pkg/rest/conn.go
index 56538f2..129eb5d 100644
--- a/pkg/rest/conn.go
+++ b/pkg/rest/conn.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package rest
 
 import (
diff --git a/pkg/rest/listener.go b/pkg/rest/listener.go
index a5f8467..7059c18 100644
--- a/pkg/rest/listener.go
+++ b/pkg/rest/listener.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package rest
 
 import (
@@ -22,15 +23,15 @@ import (
 	"syscall"
 )
 
-type TcpListener struct {
+type TCPListener struct {
 	net.Listener
 	stopCh chan error
 	closed bool
 	server *Server
 }
 
-func NewTcpListener(l net.Listener, srv *Server) (el *TcpListener) {
-	el = &TcpListener{
+func NewTCPListener(l net.Listener, srv *Server) (el *TCPListener) {
+	el = &TCPListener{
 		Listener: l,
 		stopCh:   make(chan error),
 		server:   srv,
@@ -42,15 +43,20 @@ func NewTcpListener(l net.Listener, srv *Server) (el *TcpListener) {
 	return
 }
 
-func (rl *TcpListener) Accept() (c net.Conn, err error) {
+func (rl *TCPListener) Accept() (c net.Conn, err error) {
 	tc, err := rl.Listener.(*net.TCPListener).AcceptTCP()
 	if err != nil {
 		return
 	}
 
 	if rl.server.KeepaliveTimeout > 0 {
-		tc.SetKeepAlive(true)
-		tc.SetKeepAlivePeriod(rl.server.KeepaliveTimeout)
+		if err := tc.SetKeepAlive(true); err != nil {
+			return nil, err
+		}
+		err = tc.SetKeepAlivePeriod(rl.server.KeepaliveTimeout)
+		if err != nil {
+			return nil, err
+		}
 	}
 
 	c = restConn{
@@ -62,7 +68,7 @@ func (rl *TcpListener) Accept() (c net.Conn, err error) {
 	return
 }
 
-func (rl *TcpListener) Close() error {
+func (rl *TCPListener) Close() error {
 	if rl.closed {
 		return syscall.EINVAL
 	}
@@ -71,7 +77,7 @@ func (rl *TcpListener) Close() error {
 	return <-rl.stopCh
 }
 
-func (rl *TcpListener) File() *os.File {
+func (rl *TCPListener) File() *os.File {
 	tl := rl.Listener.(*net.TCPListener)
 	fl, _ := tl.File()
 	return fl
diff --git a/pkg/rest/roa.go b/pkg/rest/roa.go
index 5bff1bd..d28e569 100644
--- a/pkg/rest/roa.go
+++ b/pkg/rest/roa.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package rest
 
 import (
diff --git a/pkg/rest/route.go b/pkg/rest/route.go
index d8f220e..a0b66d5 100644
--- a/pkg/rest/route.go
+++ b/pkg/rest/route.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package rest
 
 import (
@@ -166,7 +167,7 @@ func (roa *ROAServerHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 
-	w.Header().Add(HEADER_ALLOW, util.StringJoin(allowed, ", "))
+	w.Header().Add(HeaderAllow, util.StringJoin(allowed, ", "))
 	http.Error(w, "Method Not Allowed", http.StatusMethodNotAllowed)
 }
 
@@ -178,17 +179,17 @@ func (roa *ROAServerHandler) serve(ph *urlPatternHandler, w http.ResponseWriter,
 	}
 
 	inv := chain.NewInvocation(ctx, chain.NewChain(roa.chainName, chain.Handlers(roa.chainName)))
-	inv.WithContext(CTX_RESPONSE, w).
-		WithContext(CTX_REQUEST, r).
-		WithContext(CTX_MATCH_PATTERN, ph.Path).
-		WithContext(CTX_MATCH_FUNC, ph.Name).
+	inv.WithContext(CtxResponse, w).
+		WithContext(CtxRequest, r).
+		WithContext(CtxMatchPattern, ph.Path).
+		WithContext(CtxMatchFunc, ph.Name).
 		Invoke(
 			func(ret chain.Result) {
 				defer func() {
 					err := ret.Err
 					itf := recover()
 					if itf != nil {
-						log.LogPanic(itf)
+						log.Panic(itf)
 
 						err = errorsEx.RaiseError(itf)
 					}
diff --git a/pkg/rest/server.go b/pkg/rest/server.go
index 16c7e2c..1c060ad 100644
--- a/pkg/rest/server.go
+++ b/pkg/rest/server.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package rest
 
 import (
@@ -104,7 +105,7 @@ type Server struct {
 
 	Listener    net.Listener
 	netListener net.Listener
-	tcpListener *TcpListener
+	tcpListener *TCPListener
 
 	conns int64
 	wg    sync.WaitGroup
@@ -154,7 +155,7 @@ func (srv *Server) Listen() error {
 		return err
 	}
 
-	srv.Listener = NewTcpListener(l, srv)
+	srv.Listener = NewTCPListener(l, srv)
 	grace.RegisterFiles(addr, srv.File())
 	return nil
 }
@@ -170,7 +171,7 @@ func (srv *Server) ListenTLS() error {
 		return err
 	}
 
-	srv.tcpListener = NewTcpListener(l, srv)
+	srv.tcpListener = NewTCPListener(l, srv)
 	srv.Listener = tls.NewListener(srv.tcpListener, srv.TLSConfig)
 	grace.RegisterFiles(addr, srv.File())
 	return nil
@@ -283,8 +284,8 @@ func (srv *Server) gracefulStop(d time.Duration) {
 
 func (srv *Server) File() *os.File {
 	switch srv.Listener.(type) {
-	case *TcpListener:
-		return srv.Listener.(*TcpListener).File()
+	case *TCPListener:
+		return srv.Listener.(*TCPListener).File()
 	default:
 		return srv.tcpListener.File()
 	}
diff --git a/pkg/rpc/grpc.go b/pkg/rpc/grpc.go
index eaa9ec7..2097a9c 100644
--- a/pkg/rpc/grpc.go
+++ b/pkg/rpc/grpc.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package rpc
 
 import "google.golang.org/grpc"
diff --git a/pkg/task/executor.go b/pkg/task/executor.go
index 9e0b608..0146698 100644
--- a/pkg/task/executor.go
+++ b/pkg/task/executor.go
@@ -14,12 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package task
 
 import (
 	"context"
 	"errors"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
+	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/queue"
 )
 
@@ -49,7 +51,10 @@ func (s *Executor) Execute() {
 		}
 		s.pool.Do(func(ctx context.Context) {
 			at := task.(Task)
-			at.Do(ctx)
+			err := at.Do(ctx)
+			if err != nil {
+				log.Error("", err)
+			}
 			s.latestTask = at
 		})
 	default:
diff --git a/pkg/task/service.go b/pkg/task/service.go
index 10dad53..a84bd70 100644
--- a/pkg/task/service.go
+++ b/pkg/task/service.go
@@ -14,12 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package task
 
 import "sync"
 
 var (
-	service TaskService
+	service Service
 	once    sync.Once
 )
 
@@ -27,7 +28,7 @@ func init() {
 	service = NewTaskService()
 }
 
-func Service() TaskService {
+func GetService() Service {
 	once.Do(service.Run)
 	return service
 }
diff --git a/pkg/task/service_async.go b/pkg/task/service_async.go
index 0b96d70..4def6f7 100644
--- a/pkg/task/service_async.go
+++ b/pkg/task/service_async.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package task
 
 import (
@@ -209,7 +210,7 @@ func (lat *AsyncTaskService) renew() {
 	lat.executors = newExecutor
 }
 
-func NewTaskService() TaskService {
+func NewTaskService() Service {
 	lat := &AsyncTaskService{
 		goroutine: gopool.New(context.Background()),
 		ready:     make(chan struct{}),
diff --git a/pkg/task/task.go b/pkg/task/task.go
index 0788ef5..ff7906f 100644
--- a/pkg/task/task.go
+++ b/pkg/task/task.go
@@ -13,7 +13,9 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ *
  */
+
 package task
 
 import "context"
@@ -24,7 +26,7 @@ type Task interface {
 	Err() error
 }
 
-type TaskService interface {
+type Service interface {
 	Add(ctx context.Context, task Task) error
 	LatestHandled(key string) (Task, error)
 
diff --git a/pkg/tlsutil/common.go b/pkg/tlsutil/common.go
index 061cb44..62e0cdb 100644
--- a/pkg/tlsutil/common.go
+++ b/pkg/tlsutil/common.go
@@ -19,8 +19,7 @@ import (
 	"crypto/tls"
 )
 
-// const
-var TLS_CIPHER_SUITE_MAP = map[string]uint16{
+var TLSCipherSuiteMap = map[string]uint16{
 	"TLS_RSA_WITH_AES_128_GCM_SHA256":       tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
 	"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
 	"TLS_RSA_WITH_AES_256_GCM_SHA384":       tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
@@ -28,7 +27,7 @@ var TLS_CIPHER_SUITE_MAP = map[string]uint16{
 	"TLS_RSA_WITH_AES_128_CBC_SHA256":       tls.TLS_RSA_WITH_AES_128_CBC_SHA256,
 }
 
-var TLS_VERSION_MAP = map[string]uint16{
+var TLSVersionMap = map[string]uint16{
 	"TLSv1.0": tls.VersionTLS10,
 	"TLSv1.1": tls.VersionTLS11,
 	"TLSv1.2": tls.VersionTLS12,
@@ -43,7 +42,7 @@ func TLSCipherSuits() []uint16 {
 	if cipherSuite != nil {
 		return cipherSuite
 	}
-	for _, c := range TLS_CIPHER_SUITE_MAP {
+	for _, c := range TLSCipherSuiteMap {
 		cipherSuite = append(cipherSuite, c)
 	}
 	return cipherSuite
diff --git a/pkg/tlsutil/tls13.go b/pkg/tlsutil/tls13.go
index 75cd211..d8e45fd 100644
--- a/pkg/tlsutil/tls13.go
+++ b/pkg/tlsutil/tls13.go
@@ -21,6 +21,6 @@ import "crypto/tls"
 
 func init() {
 	// Add TLS 1.3 version
-	TLS_VERSION_MAP["TLSv1.3"] = tls.VersionTLS13
+	TLSVersionMap["TLSv1.3"] = tls.VersionTLS13
 	MaxSupportedTLSVersion = tls.VersionTLS13
 }
diff --git a/pkg/tlsutil/tlsutil.go b/pkg/tlsutil/tlsutil.go
index 87f6992..e4dcc59 100644
--- a/pkg/tlsutil/tlsutil.go
+++ b/pkg/tlsutil/tlsutil.go
@@ -25,8 +25,8 @@ import (
 	"strings"
 )
 
-func ParseSSLCipherSuites(ciphers string, permitTlsCipherSuiteMap map[string]uint16) []uint16 {
-	if len(ciphers) == 0 || len(permitTlsCipherSuiteMap) == 0 {
+func ParseSSLCipherSuites(ciphers string, permitTLSCipherSuiteMap map[string]uint16) []uint16 {
+	if len(ciphers) == 0 || len(permitTLSCipherSuiteMap) == 0 {
 		return nil
 	}
 
@@ -38,7 +38,7 @@ func ParseSSLCipherSuites(ciphers string, permitTlsCipherSuiteMap map[string]uin
 			continue
 		}
 
-		if cipherSuite, ok := permitTlsCipherSuiteMap[cipherSuiteName]; ok {
+		if cipherSuite, ok := permitTLSCipherSuiteMap[cipherSuiteName]; ok {
 			cipherSuiteList = append(cipherSuiteList, cipherSuite)
 		} else {
 			// 配置算法不存在
@@ -50,12 +50,12 @@ func ParseSSLCipherSuites(ciphers string, permitTlsCipherSuiteMap map[string]uin
 }
 
 func ParseDefaultSSLCipherSuites(ciphers string) []uint16 {
-	return ParseSSLCipherSuites(ciphers, TLS_CIPHER_SUITE_MAP)
+	return ParseSSLCipherSuites(ciphers, TLSCipherSuiteMap)
 }
 
 func ParseSSLProtocol(sprotocol string) uint16 {
 	var result uint16 = tls.VersionTLS12
-	if protocol, ok := TLS_VERSION_MAP[sprotocol]; ok {
+	if protocol, ok := TLSVersionMap[sprotocol]; ok {
 		result = protocol
 	} else {
 		log.Warnf("invalid ssl minimal version(%s), use default.", sprotocol)
diff --git a/server/service/util/common.go b/pkg/util/common.go
similarity index 79%
rename from server/service/util/common.go
rename to pkg/util/common.go
index b34362d..2c92e57 100644
--- a/server/service/util/common.go
+++ b/pkg/util/common.go
@@ -14,15 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package util
 
 const (
-	HEADER_REV            = "X-Resource-Revision"
-	CTX_GLOBAL            = "global"
-	CTX_NOCACHE           = "noCache"
-	CTX_CACHEONLY         = "cacheOnly"
-	CTX_REQUEST_REVISION  = "requestRev"
-	CTX_RESPONSE_REVISION = "responseRev"
+	HeaderRev           = "X-Resource-Revision"
+	CtxGlobal           = "global"
+	CtxNocache          = "noCache"
+	CtxCacheOnly        = "cacheOnly"
+	CtxRequestRevision  = "requestRev"
+	CtxResponseRevision = "responseRev"
 )
 
 const (
diff --git a/pkg/util/concurrent_map_go19.go b/pkg/util/concurrent_map_go19.go
index 513eaa0..c6b7da2 100644
--- a/pkg/util/concurrent_map_go19.go
+++ b/pkg/util/concurrent_map_go19.go
@@ -33,7 +33,6 @@ func (cm *ConcurrentMap) Put(key, val interface{}) {
 	cm.fetchLock.RLock()
 	cm.mapper.Store(key, val)
 	cm.fetchLock.RUnlock()
-	return
 }
 
 func (cm *ConcurrentMap) PutIfAbsent(key, val interface{}) (exist interface{}) {
diff --git a/pkg/util/context.go b/pkg/util/context.go
index fe326cc..d1d4ceb 100644
--- a/pkg/util/context.go
+++ b/pkg/util/context.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package util
 
 import (
diff --git a/pkg/util/net.go b/pkg/util/net.go
index f890d55..08f4f17 100644
--- a/pkg/util/net.go
+++ b/pkg/util/net.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package util
 
 import (
@@ -25,7 +26,7 @@ import (
 	"strings"
 )
 
-type IpPort struct {
+type IPPort struct {
 	IP   string
 	Port uint16
 }
@@ -46,13 +47,13 @@ func ParseEndpoint(ep string) (string, error) {
 	return u.Host, nil
 }
 
-func ParseIpPort(addr string) IpPort {
+func ParseIPPort(addr string) IPPort {
 	idx := strings.LastIndex(addr, ":")
 	if idx == -1 {
-		return IpPort{addr, 0}
+		return IPPort{addr, 0}
 	}
 	p, _ := strconv.Atoi(addr[idx+1:])
-	return IpPort{addr[:idx], uint16(p)}
+	return IPPort{addr[:idx], uint16(p)}
 }
 
 func GetRealIP(r *http.Request) string {
diff --git a/pkg/util/net_test.go b/pkg/util/net_test.go
index a5dbfdf..4478475 100644
--- a/pkg/util/net_test.go
+++ b/pkg/util/net_test.go
@@ -61,13 +61,13 @@ func TestInetNtoa(t *testing.T) {
 }
 
 func TestParseIpPort(t *testing.T) {
-	ipPort := ParseIpPort("0.0.0.0")
+	ipPort := ParseIPPort("0.0.0.0")
 	if ipPort.IP != "0.0.0.0" || ipPort.Port != 0 {
-		t.Fatalf("ParseIpPort(0.0.0.0) error")
+		t.Fatalf("ParseIPPort(0.0.0.0) error")
 	}
-	ipPort = ParseIpPort("0.0.0.0:1")
+	ipPort = ParseIPPort("0.0.0.0:1")
 	if ipPort.IP != "0.0.0.0" || ipPort.Port != 1 {
-		t.Fatalf("ParseIpPort(0.0.0.0) error")
+		t.Fatalf("ParseIPPort(0.0.0.0) error")
 	}
 }
 
diff --git a/pkg/util/reflect.go b/pkg/util/reflect.go
index f45572a..9e45e34 100644
--- a/pkg/util/reflect.go
+++ b/pkg/util/reflect.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package util
 
 import (
@@ -26,16 +27,16 @@ import (
 
 var (
 	reflector *Reflector
-	unknown   = new(reflectObject)
+	unknown   = new(ReflectObject)
 )
 
 func init() {
 	reflector = &Reflector{
-		types: make(map[*uintptr]*reflectObject),
+		types: make(map[*uintptr]*ReflectObject),
 	}
 }
 
-type reflectObject struct {
+type ReflectObject struct {
 	// full name
 	FullName string
 	Type     reflect.Type
@@ -44,16 +45,16 @@ type reflectObject struct {
 }
 
 // Name returns a short name of the object type
-func (o *reflectObject) Name() string {
+func (o *ReflectObject) Name() string {
 	return FileLastName(o.FullName)
 }
 
 type Reflector struct {
-	types map[*uintptr]*reflectObject
+	types map[*uintptr]*ReflectObject
 	mux   sync.RWMutex
 }
 
-func (r *Reflector) Load(obj interface{}) *reflectObject {
+func (r *Reflector) Load(obj interface{}) *ReflectObject {
 	r.mux.RLock()
 	itab := *(**uintptr)(unsafe.Pointer(&obj))
 	t, ok := r.types[itab]
@@ -69,7 +70,7 @@ func (r *Reflector) Load(obj interface{}) *reflectObject {
 		return t
 	}
 
-	t = new(reflectObject)
+	t = new(ReflectObject)
 	v := reflect.ValueOf(obj)
 	if !v.IsValid() {
 		r.mux.Unlock()
@@ -118,7 +119,7 @@ func (r *Reflector) Load(obj interface{}) *reflectObject {
 	return t
 }
 
-func Reflect(obj interface{}) *reflectObject {
+func Reflect(obj interface{}) *ReflectObject {
 	return reflector.Load(obj)
 }
 
diff --git a/pkg/util/sys.go b/pkg/util/sys.go
index 8faf8ae..ad705a3 100644
--- a/pkg/util/sys.go
+++ b/pkg/util/sys.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package util
 
 import (
diff --git a/pkg/util/tree.go b/pkg/util/tree.go
index f21f3e3..e959785 100644
--- a/pkg/util/tree.go
+++ b/pkg/util/tree.go
@@ -14,16 +14,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package util
 
-//The tree is binary sort tree
-type tree struct {
+//The Tree is binary sort Tree
+type Tree struct {
 	root        *Node
 	isAddToLeft func(node *Node, addRes interface{}) bool
 }
 
-func NewTree(isAddToLeft func(node *Node, addRes interface{}) bool) *tree {
-	return &tree{
+func NewTree(isAddToLeft func(node *Node, addRes interface{}) bool) *Tree {
+	return &Tree{
 		isAddToLeft: isAddToLeft,
 	}
 }
@@ -33,16 +34,16 @@ type Node struct {
 	left, right *Node
 }
 
-func (t *tree) GetRoot() *Node {
+func (t *Tree) GetRoot() *Node {
 	return t.root
 }
 
-//add res into tree
-func (t *tree) AddNode(res interface{}) *Node {
+//add res into Tree
+func (t *Tree) AddNode(res interface{}) *Node {
 	return t.addNode(t.root, res)
 }
 
-func (t *tree) addNode(n *Node, res interface{}) *Node {
+func (t *Tree) addNode(n *Node, res interface{}) *Node {
 	if n == nil {
 		n = new(Node)
 		n.Res = res
@@ -60,7 +61,7 @@ func (t *tree) addNode(n *Node, res interface{}) *Node {
 }
 
 //middle oder traversal, handle is the func that deals with the res, n is the start node to traversal
-func (t *tree) InOrderTraversal(n *Node, handle func(res interface{}) error) error {
+func (t *Tree) InOrderTraversal(n *Node, handle func(res interface{}) error) error {
 	if n == nil {
 		return nil
 	}
diff --git a/pkg/util/util.go b/pkg/util/util.go
index d824edf..65fd822 100644
--- a/pkg/util/util.go
+++ b/pkg/util/util.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package util
 
 import (
diff --git a/pkg/util/uuid.go b/pkg/util/uuid.go
index 198a5da..53375b0 100644
--- a/pkg/util/uuid.go
+++ b/pkg/util/uuid.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package util
 
 import (
@@ -23,6 +24,6 @@ import (
 
 const DASH = "-"
 
-func GenerateUuid() string {
+func GenerateUUID() string {
 	return strings.Replace(uuid.NewV1().String(), string(DASH), "", -1)
 }
diff --git a/pkg/util/uuid_test.go b/pkg/util/uuid_test.go
index 392db1c..6bd8b94 100644
--- a/pkg/util/uuid_test.go
+++ b/pkg/util/uuid_test.go
@@ -22,7 +22,7 @@ import (
 )
 
 func TestGenerateUuid(t *testing.T) {
-	uuid := GenerateUuid()
+	uuid := GenerateUUID()
 	if len(uuid) == 0 || strings.Contains(uuid, "-") {
 		t.Fatalf("TestGenerateUuid failed")
 	}
diff --git a/pkg/validate/func.go b/pkg/validate/func.go
index 3baaf67..66e7ba7 100644
--- a/pkg/validate/func.go
+++ b/pkg/validate/func.go
@@ -14,9 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package validate
 
-type ValidateFunc interface {
+type Method interface {
 	MatchString(s string) bool
 	String() string
 }
diff --git a/pkg/validate/rule.go b/pkg/validate/rule.go
index 981af9e..c43cf70 100644
--- a/pkg/validate/rule.go
+++ b/pkg/validate/rule.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package validate
 
 import (
@@ -23,14 +24,14 @@ import (
 	"unicode/utf8"
 )
 
-type ValidateRule struct {
+type Rule struct {
 	Min    int
 	Max    int
-	Regexp ValidateFunc
+	Regexp Method
 	Hide   bool // if true, do not print the value when return invalid result
 }
 
-func (v *ValidateRule) String() string {
+func (v *Rule) String() string {
 	arr := [4]string{}
 	s := arr[:0]
 	if v.Min != 0 {
@@ -45,7 +46,7 @@ func (v *ValidateRule) String() string {
 	return "{" + util.StringJoin(s, ", ") + "}"
 }
 
-func (v *ValidateRule) Match(s interface{}) (ok bool, invalidValue interface{}) {
+func (v *Rule) Match(s interface{}) (ok bool, invalidValue interface{}) {
 	invalidValue = s
 	var invalid bool
 	sv := reflect.ValueOf(s)
@@ -87,7 +88,7 @@ func (v *ValidateRule) Match(s interface{}) (ok bool, invalidValue interface{})
 	if v.Regexp != nil && !invalid {
 		switch k {
 		case reflect.Map:
-			itemV := ValidateRule{
+			itemV := Rule{
 				Regexp: v.Regexp,
 			}
 			keys := sv.MapKeys()
@@ -104,7 +105,7 @@ func (v *ValidateRule) Match(s interface{}) (ok bool, invalidValue interface{})
 				}
 			}
 		case reflect.Slice, reflect.Array:
-			itemV := ValidateRule{
+			itemV := Rule{
 				Regexp: v.Regexp,
 			}
 			for i, l := 0, sv.Len(); i < l; i++ {
diff --git a/pkg/validate/url.go b/pkg/validate/url.go
index 824d0a4..27096fa 100644
--- a/pkg/validate/url.go
+++ b/pkg/validate/url.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package validate
 
 import (
diff --git a/pkg/validate/validator.go b/pkg/validate/validator.go
index c819450..1720a95 100644
--- a/pkg/validate/validator.go
+++ b/pkg/validate/validator.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package validate
 
 import (
@@ -25,7 +26,7 @@ import (
 )
 
 type Validator struct {
-	rules map[string](*ValidateRule)
+	rules map[string](*Rule)
 	subs  map[string](*Validator)
 	once  sync.Once
 }
@@ -37,25 +38,25 @@ func (v *Validator) Init(f func(*Validator)) *Validator {
 	return v
 }
 
-func (v *Validator) GetRule(name string) *ValidateRule {
+func (v *Validator) GetRule(name string) *Rule {
 	if v.rules == nil {
 		return nil
 	}
 	return v.rules[name]
 }
 
-func (v *Validator) AddRule(name string, rule *ValidateRule) {
+func (v *Validator) AddRule(name string, rule *Rule) {
 	if v.rules == nil {
-		v.rules = make(map[string](*ValidateRule))
+		v.rules = make(map[string](*Rule))
 	}
 	v.rules[name] = rule
 }
 
-func (v *Validator) GetRules() map[string](*ValidateRule) {
+func (v *Validator) GetRules() map[string](*Rule) {
 	return v.rules
 }
 
-func (v *Validator) AddRules(in map[string](*ValidateRule)) {
+func (v *Validator) AddRules(in map[string](*Rule)) {
 	if len(in) == 0 {
 		return
 	}
diff --git a/pkg/validate/validator_test.go b/pkg/validate/validator_test.go
index 27029d5..51f1182 100644
--- a/pkg/validate/validator_test.go
+++ b/pkg/validate/validator_test.go
@@ -52,7 +52,7 @@ func TestValidator_Validate(t *testing.T) {
 
 	s := new(S)
 
-	v.AddRule("A", &ValidateRule{Min: 1, Max: 2})
+	v.AddRule("A", &Rule{Min: 1, Max: 2})
 	err := v.Validate(s)
 	if err == nil {
 		t.Fatalf("validate failed")
@@ -76,7 +76,7 @@ func TestValidator_Validate(t *testing.T) {
 	}
 
 	r, _ := regexp.Compile(`^\d*$`)
-	v.AddRule("B", &ValidateRule{Min: 1, Max: 2, Regexp: r})
+	v.AddRule("B", &Rule{Min: 1, Max: 2, Regexp: r})
 	err = v.Validate(s)
 	if err == nil {
 		t.Fatalf("validate failed")
@@ -99,7 +99,7 @@ func TestValidator_Validate(t *testing.T) {
 		t.Fatalf("validate failed, %s", err.Error())
 	}
 
-	v.AddRule("D", &ValidateRule{Regexp: r})
+	v.AddRule("D", &Rule{Regexp: r})
 	err = v.Validate(s)
 	if err != nil {
 		t.Fatalf("validate failed, %s", err.Error())
@@ -116,7 +116,7 @@ func TestValidator_Validate(t *testing.T) {
 		t.Fatalf("validate failed, %s", err.Error())
 	}
 
-	v.AddRule("E", &ValidateRule{Min: 1, Max: 2, Regexp: r})
+	v.AddRule("E", &Rule{Min: 1, Max: 2, Regexp: r})
 	err = v.Validate(s)
 	if err == nil {
 		t.Fatalf("validate failed")
@@ -139,7 +139,7 @@ func TestValidator_Validate(t *testing.T) {
 		t.Fatalf("validate failed, %s", err.Error())
 	}
 
-	v.AddRule("F", &ValidateRule{Min: 1, Max: 2, Regexp: r})
+	v.AddRule("F", &Rule{Min: 1, Max: 2, Regexp: r})
 	err = v.Validate(s)
 	if err == nil {
 		t.Fatalf("validate failed")
@@ -170,7 +170,7 @@ func TestValidator_Validate(t *testing.T) {
 
 	// sub struct
 	pr, _ := regexp.Compile(`^[a-z]*$`)
-	v.AddRule("G", &ValidateRule{Regexp: pr})
+	v.AddRule("G", &Rule{Regexp: pr})
 	v.AddSub("G", &v)
 	err = v.Validate(s)
 	if err == nil {
@@ -196,7 +196,7 @@ func TestValidator_Validate(t *testing.T) {
 
 	// just check sub
 	var hv Validator
-	hv.AddRule("H", &ValidateRule{Min: 1, Max: 2, Regexp: pr})
+	hv.AddRule("H", &Rule{Min: 1, Max: 2, Regexp: pr})
 	v.AddSub("H", &hv)
 	err = v.Validate(s)
 	if err != nil {
@@ -204,7 +204,7 @@ func TestValidator_Validate(t *testing.T) {
 	}
 
 	// also check nil pointer
-	v.AddRule("H", &ValidateRule{Min: 1, Max: 2, Regexp: pr})
+	v.AddRule("H", &Rule{Min: 1, Max: 2, Regexp: pr})
 	v.AddSub("H", &v)
 	err = v.Validate(s)
 	if err == nil {
@@ -234,7 +234,7 @@ func TestValidator_Validate(t *testing.T) {
 		t.Fatalf("validate failed, %s", err.Error())
 	}
 
-	v.AddRule("I", &ValidateRule{Regexp: pr})
+	v.AddRule("I", &Rule{Regexp: pr})
 	v.AddSub("I", &v)
 	err = v.Validate(s)
 	if err == nil {
@@ -264,7 +264,7 @@ func TestValidator_Validate(t *testing.T) {
 		t.Fatalf("validate failed, %s", err.Error())
 	}
 
-	v.AddRule("J", &ValidateRule{Min: 1, Max: 2, Regexp: pr})
+	v.AddRule("J", &Rule{Min: 1, Max: 2, Regexp: pr})
 	v.AddSub("J", &v)
 	err = v.Validate(s)
 	if err == nil {
@@ -300,7 +300,7 @@ func TestValidator_Validate(t *testing.T) {
 		t.Fatalf("validate failed, %s", err.Error())
 	}
 
-	v.AddRule("K", &ValidateRule{Min: 1, Regexp: pr})
+	v.AddRule("K", &Rule{Min: 1, Regexp: pr})
 	v.AddSub("K", &v)
 	err = v.Validate(s)
 	if err == nil {
@@ -330,7 +330,7 @@ func TestValidator_Validate(t *testing.T) {
 		t.Fatalf("validate failed, %s", err.Error())
 	}
 
-	v.AddRule("L", &ValidateRule{Min: 1, Max: 2, Regexp: pr})
+	v.AddRule("L", &Rule{Min: 1, Max: 2, Regexp: pr})
 	v.AddSub("L", &v)
 	err = v.Validate(s)
 	if err == nil {
@@ -366,7 +366,7 @@ func TestValidator_Validate(t *testing.T) {
 		t.Fatalf("validate failed, %s", err.Error())
 	}
 
-	v.AddRule("M", &ValidateRule{Min: 1, Max: 2, Regexp: pr})
+	v.AddRule("M", &Rule{Min: 1, Max: 2, Regexp: pr})
 	v.AddSub("M", &v)
 	err = v.Validate(s)
 	if err == nil {
@@ -402,7 +402,7 @@ func TestValidator_Validate(t *testing.T) {
 		t.Fatalf("validate failed, %s", err.Error())
 	}
 
-	v.AddRule("N", &ValidateRule{Min: 1, Max: 2, Regexp: pr})
+	v.AddRule("N", &Rule{Min: 1, Max: 2, Regexp: pr})
 	v.AddSub("N", &v)
 	err = v.Validate(s)
 	if err == nil {
@@ -438,9 +438,9 @@ func TestValidator_Validate(t *testing.T) {
 		t.Fatalf("validate failed, %s", err.Error())
 	}
 
-	v.AddRule("O", &ValidateRule{Min: 1, Max: 2, Regexp: pr})
+	v.AddRule("O", &Rule{Min: 1, Max: 2, Regexp: pr})
 	v.AddSub("O", &v)
-	v.AddRule("CH", &ValidateRule{Min: 1, Max: 2, Regexp: pr})
+	v.AddRule("CH", &Rule{Min: 1, Max: 2, Regexp: pr})
 	v.AddSub("CH", &v)
 	err = v.Validate(s)
 	if err == nil {
diff --git a/pkg/client/etcd/client.go b/scctl/etcd/client.go
similarity index 97%
rename from pkg/client/etcd/client.go
rename to scctl/etcd/client.go
index 2945e85..c8eb312 100644
--- a/pkg/client/etcd/client.go
+++ b/scctl/etcd/client.go
@@ -30,7 +30,7 @@ func NewEtcdClient(cfg Config) (*clientv3.Client, error) {
 		cliTls    *tls.Config
 	)
 	for _, ip := range endpoints {
-		if strings.Index(ip, "https://") >= 0 {
+		if strings.Contains(ip, "https://") {
 			if len(cfg.CertKeyPWD) == 0 && len(cfg.CertKeyPWDPath) > 0 {
 				content, _ := ioutil.ReadFile(cfg.CertKeyPWDPath)
 				cfg.CertKeyPWD = string(content)
diff --git a/pkg/client/etcd/config.go b/scctl/etcd/config.go
similarity index 100%
rename from pkg/client/etcd/config.go
rename to scctl/etcd/config.go
diff --git a/scctl/pkg/model/types.go b/scctl/pkg/model/types.go
index 6c7c3e9..3a1a06f 100644
--- a/scctl/pkg/model/types.go
+++ b/scctl/pkg/model/types.go
@@ -16,8 +16,8 @@
 package model
 
 import (
+	"github.com/apache/servicecomb-service-center/pkg/model"
 	"github.com/apache/servicecomb-service-center/pkg/util"
-	"github.com/apache/servicecomb-service-center/server/admin/model"
 	"github.com/apache/servicecomb-service-center/server/core"
 	"github.com/apache/servicecomb-service-center/server/core/proto"
 	"strconv"
@@ -78,7 +78,7 @@ func (s *Service) UpdateTimestamp(t string) {
 }
 
 func (s *Service) Age() time.Duration {
-	return time.Now().Sub(time.Unix(s.Timestamp, 0).Local())
+	return time.Since(time.Unix(s.Timestamp, 0).Local())
 }
 
 type Instance struct {
@@ -118,5 +118,5 @@ func (s *Instance) UpdateTimestamp(t string) {
 }
 
 func (s *Instance) Age() time.Duration {
-	return time.Now().Sub(time.Unix(s.Timestamp, 0).Local())
+	return time.Since(time.Unix(s.Timestamp, 0).Local())
 }
diff --git a/scctl/pkg/plugin/diagnose/cmd.go b/scctl/pkg/plugin/diagnose/cmd.go
index 1ef277a..a0e5f3d 100644
--- a/scctl/pkg/plugin/diagnose/cmd.go
+++ b/scctl/pkg/plugin/diagnose/cmd.go
@@ -16,8 +16,8 @@
 package diagnose
 
 import (
-	"github.com/apache/servicecomb-service-center/pkg/client/etcd"
 	"github.com/apache/servicecomb-service-center/pkg/util"
+	"github.com/apache/servicecomb-service-center/scctl/etcd"
 	root "github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
 	"github.com/spf13/cobra"
 	"path/filepath"
diff --git a/scctl/pkg/plugin/diagnose/compare_holder.go b/scctl/pkg/plugin/diagnose/compare_holder.go
index 08ba9df..2464f6f 100644
--- a/scctl/pkg/plugin/diagnose/compare_holder.go
+++ b/scctl/pkg/plugin/diagnose/compare_holder.go
@@ -19,7 +19,7 @@ import (
 	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
-	"github.com/apache/servicecomb-service-center/server/admin/model"
+	"github.com/apache/servicecomb-service-center/pkg/model"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/coreos/etcd/mvcc/mvccpb"
 )
diff --git a/scctl/pkg/plugin/diagnose/compare_holder_test.go b/scctl/pkg/plugin/diagnose/compare_holder_test.go
index b3a6d97..6928342 100644
--- a/scctl/pkg/plugin/diagnose/compare_holder_test.go
+++ b/scctl/pkg/plugin/diagnose/compare_holder_test.go
@@ -16,22 +16,22 @@
 package diagnose
 
 import (
-	"github.com/apache/servicecomb-service-center/server/admin/model"
+	model2 "github.com/apache/servicecomb-service-center/pkg/model"
 	"github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/coreos/etcd/mvcc/mvccpb"
 	"testing"
 )
 
 func TestAbstractCompareHolder_Compare(t *testing.T) {
-	services := model.MicroserviceSlice{
-		model.NewMicroservice(&model.KV{Key: "1", Rev: 1, Value: &proto.MicroService{ServiceId: "1"}}), // greater
-		model.NewMicroservice(&model.KV{Key: "2", Rev: 1, Value: &proto.MicroService{ServiceId: "2"}}), // mismatch
-		model.NewMicroservice(&model.KV{Key: "4", Rev: 2, Value: &proto.MicroService{ServiceId: "4"}}), // pass
+	services := model2.MicroserviceSlice{
+		model2.NewMicroservice(&model2.KV{Key: "1", Rev: 1, Value: &proto.MicroService{ServiceId: "1"}}), // greater
+		model2.NewMicroservice(&model2.KV{Key: "2", Rev: 1, Value: &proto.MicroService{ServiceId: "2"}}), // mismatch
+		model2.NewMicroservice(&model2.KV{Key: "4", Rev: 2, Value: &proto.MicroService{ServiceId: "4"}}), // pass
 	}
 	kvs := []*mvccpb.KeyValue{
-		{Key: []byte("2"), ModRevision: 2, Value: []byte(`{"ServiceId":"22"}`)},
-		{Key: []byte("3"), ModRevision: 3, Value: []byte(`{"ServiceId":"3"}`)}, // less
-		{Key: []byte("4"), ModRevision: 2, Value: []byte(`{"ServiceId":"4"}`)},
+		{Key: []byte("2"), ModRevision: 2, Value: []byte(`{"ServiceID":"22"}`)},
+		{Key: []byte("3"), ModRevision: 3, Value: []byte(`{"ServiceID":"3"}`)}, // less
+		{Key: []byte("4"), ModRevision: 2, Value: []byte(`{"ServiceID":"4"}`)},
 		{Key: []byte("5"), ModRevision: 4, Value: []byte(`xxxx`)},
 	}
 	service := ServiceCompareHolder{Cache: services, Kvs: kvs}
diff --git a/scctl/pkg/plugin/diagnose/diagnose.go b/scctl/pkg/plugin/diagnose/diagnose.go
index da0c8be..0b6a25d 100644
--- a/scctl/pkg/plugin/diagnose/diagnose.go
+++ b/scctl/pkg/plugin/diagnose/diagnose.go
@@ -19,10 +19,10 @@ import (
 	"bytes"
 	"context"
 	"fmt"
-	"github.com/apache/servicecomb-service-center/pkg/client/etcd"
 	"github.com/apache/servicecomb-service-center/pkg/client/sc"
+	"github.com/apache/servicecomb-service-center/pkg/model"
+	"github.com/apache/servicecomb-service-center/scctl/etcd"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
-	"github.com/apache/servicecomb-service-center/server/admin/model"
 	"github.com/coreos/etcd/clientv3"
 	"github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/spf13/cobra"
diff --git a/scctl/pkg/plugin/diagnose/diagnose_test.go b/scctl/pkg/plugin/diagnose/diagnose_test.go
index 4824da4..0a879f9 100644
--- a/scctl/pkg/plugin/diagnose/diagnose_test.go
+++ b/scctl/pkg/plugin/diagnose/diagnose_test.go
@@ -17,46 +17,46 @@ package diagnose
 
 import (
 	"fmt"
-	"github.com/apache/servicecomb-service-center/server/admin/model"
+	model2 "github.com/apache/servicecomb-service-center/pkg/model"
 	"github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/coreos/etcd/mvcc/mvccpb"
 	"testing"
 )
 
 func TestNewDiagnoseCommand(t *testing.T) {
-	services := model.MicroserviceSlice{
-		model.NewMicroservice(&model.KV{Key: "1", Rev: 1,
+	services := model2.MicroserviceSlice{
+		model2.NewMicroservice(&model2.KV{Key: "1", Rev: 1,
 			Value: &proto.MicroService{
 				ServiceId: "667570b6842411e89c66286ed488de36", AppId: "app", ServiceName: "name1", Version: "0.0.1",
 			}}), // greater
-		model.NewMicroservice(&model.KV{Key: "6", Rev: 1,
+		model2.NewMicroservice(&model2.KV{Key: "6", Rev: 1,
 			Value: &proto.MicroService{
 				ServiceId: "667570b6842411e89c66286ed488de36", AppId: "app", ServiceName: "name2", Version: "0.0.1",
 			}}), // greater
-		model.NewMicroservice(&model.KV{Key: "2", Rev: 1, Value: &proto.MicroService{ServiceId: "2"}}), // mismatch
-		model.NewMicroservice(&model.KV{Key: "4", Rev: 2, Value: &proto.MicroService{ServiceId: "4"}}), // pass
+		model2.NewMicroservice(&model2.KV{Key: "2", Rev: 1, Value: &proto.MicroService{ServiceId: "2"}}), // mismatch
+		model2.NewMicroservice(&model2.KV{Key: "4", Rev: 2, Value: &proto.MicroService{ServiceId: "4"}}), // pass
 	}
-	instances := model.InstanceSlice{
-		model.NewInstance(&model.KV{Key: "1", Rev: 1,
+	instances := model2.InstanceSlice{
+		model2.NewInstance(&model2.KV{Key: "1", Rev: 1,
 			Value: &proto.MicroServiceInstance{
 				ServiceId: "667570b6842411e89c66286ed488de36", InstanceId: "667570b6842411e89c66286ed488de36", Version: "0.0.1",
 				Endpoints: []string{"rest://127.0.0.1:8080"},
 			}}), // greater
-		model.NewInstance(&model.KV{Key: "2", Rev: 1,
+		model2.NewInstance(&model2.KV{Key: "2", Rev: 1,
 			Value: &proto.MicroServiceInstance{
 				ServiceId: "667570b6842411e89c66286ed488de36", InstanceId: "667570b6842411e89c66286ed488de36", Version: "0.0.1",
 				Endpoints: []string{"rest://127.0.0.2:8080"},
 			}}), // greater
 	}
 	kvs := []*mvccpb.KeyValue{
-		{Key: []byte("2"), ModRevision: 2, Value: []byte(`{"ServiceId":"22"}`)},
-		{Key: []byte("3"), ModRevision: 3, Value: []byte(`{"ServiceId":"3"}`)}, // less
-		{Key: []byte("4"), ModRevision: 2, Value: []byte(`{"ServiceId":"4"}`)},
+		{Key: []byte("2"), ModRevision: 2, Value: []byte(`{"ServiceID":"22"}`)},
+		{Key: []byte("3"), ModRevision: 3, Value: []byte(`{"ServiceID":"3"}`)}, // less
+		{Key: []byte("4"), ModRevision: 2, Value: []byte(`{"ServiceID":"4"}`)},
 		{Key: []byte("5"), ModRevision: 4, Value: []byte(`xxxx`)},
 	}
 
 	//for {
-	err, details := diagnose(&model.Cache{Microservices: services, Instances: instances}, etcdResponse{service: kvs})
+	err, details := diagnose(&model2.Cache{Microservices: services, Instances: instances}, etcdResponse{service: kvs})
 	if err == nil || len(details) == 0 {
 		t.Fatalf("TestNewDiagnoseCommand failed")
 	}
diff --git a/scctl/pkg/plugin/get/instance/instance_cmd.go b/scctl/pkg/plugin/get/instance/instance_cmd.go
index fe07153..81be620 100644
--- a/scctl/pkg/plugin/get/instance/instance_cmd.go
+++ b/scctl/pkg/plugin/get/instance/instance_cmd.go
@@ -18,11 +18,11 @@ package instance
 import (
 	"context"
 	"github.com/apache/servicecomb-service-center/pkg/client/sc"
+	model2 "github.com/apache/servicecomb-service-center/pkg/model"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/model"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/plugin/get"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/writer"
-	admin "github.com/apache/servicecomb-service-center/server/admin/model"
 	"github.com/apache/servicecomb-service-center/server/core"
 	"github.com/spf13/cobra"
 	"strings"
@@ -53,7 +53,7 @@ func InstanceCommandFunc(_ *cobra.Command, args []string) {
 		cmd.StopAndExit(cmd.ExitError, scErr)
 	}
 
-	svcMap := make(map[string]*admin.Microservice)
+	svcMap := make(map[string]*model2.Microservice)
 	for _, ms := range cache.Microservices {
 		svcMap[ms.Value.ServiceId] = ms
 	}
diff --git a/scctl/pkg/plugin/get/schema/schema_cmd.go b/scctl/pkg/plugin/get/schema/schema_cmd.go
index 8c1b111..645aa84 100644
--- a/scctl/pkg/plugin/get/schema/schema_cmd.go
+++ b/scctl/pkg/plugin/get/schema/schema_cmd.go
@@ -19,11 +19,11 @@ import (
 	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/client/sc"
+	model2 "github.com/apache/servicecomb-service-center/pkg/model"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/model"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/plugin/get"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/progress-bar"
-	adminModel "github.com/apache/servicecomb-service-center/server/admin/model"
 	"github.com/apache/servicecomb-service-center/server/core"
 	"github.com/spf13/cobra"
 	"io"
@@ -62,15 +62,15 @@ func NewSchemaCommand(parent *cobra.Command) *cobra.Command {
 }
 
 // schemas/[${domain}/][${project}/][${env}/]${app}/${microservice}.${version}/${schemaId}.yaml
-func saveDirectory(root string, ms *adminModel.Microservice) string {
+func saveDirectory(root string, ms *model2.Microservice) string {
 	if len(root) == 0 {
 		return ""
 	}
 	domain, project := core.FromDomainProject(model.GetDomainProject(ms))
-	if domain == core.REGISTRY_DOMAIN {
+	if domain == core.RegistryDomain {
 		domain = ""
 	}
-	if project == core.REGISTRY_DOMAIN {
+	if project == core.RegistryDomain {
 		project = ""
 	}
 	return filepath.Join(root, "schemas", domain, project, ms.Value.Environment, ms.Value.AppId, ms.Value.ServiceName+".v"+ms.Value.Version)
@@ -110,7 +110,7 @@ func SchemaCommandFunc(_ *cobra.Command, args []string) {
 			continue
 		}
 
-		schemas, err := scClient.GetSchemasByServiceId(context.Background(), domainProject, ms.Value.ServiceId)
+		schemas, err := scClient.GetSchemasByServiceID(context.Background(), domainProject, ms.Value.ServiceId)
 		if err != nil {
 			cmd.StopAndExit(cmd.ExitError, err)
 		}
diff --git a/scctl/pkg/version/version.go b/scctl/pkg/version/version.go
index eaf544c..4fc18c6 100644
--- a/scctl/pkg/version/version.go
+++ b/scctl/pkg/version/version.go
@@ -30,7 +30,7 @@ var (
 	TOOL_NAME = "scctl"
 )
 
-var versionSet version.VersionSet
+var versionSet version.Set
 
 func init() {
 	versionSet.Version = VERSION
@@ -38,6 +38,6 @@ func init() {
 	versionSet.LoadRuntimeInfo()
 }
 
-func Ver() *version.VersionSet {
+func Ver() *version.Set {
 	return &versionSet
 }
diff --git a/scripts/build/local.sh b/scripts/build/local.sh
index 8b127ea..5a5fd6b 100644
--- a/scripts/build/local.sh
+++ b/scripts/build/local.sh
@@ -49,7 +49,7 @@ build_service_center() {
     ## Build the Service-Center releases
     export GIT_COMMIT=$(git log  --pretty=format:'%h' -n 1)
     export BUILD_NUMBER=$RELEASE
-    local ldflags="${GO_LDFLAGS} -X 'github.com/apache/servicecomb-service-center/version.BUILD_TAG=$(date +%Y%m%d%H%M%S).$BUILD_NUMBER.$GIT_COMMIT'"
+    local ldflags="${GO_LDFLAGS} -X 'github.com/apache/servicecomb-service-center/version.BuildTag=$(date +%Y%m%d%H%M%S).$BUILD_NUMBER.$GIT_COMMIT'"
     ldflags="${ldflags} -X 'github.com/apache/servicecomb-service-center/version.VERSION=$BUILD_NUMBER'"
     local BINARY_NAME=$app/service-center
     if [ "$GOOS" == "windows" ]; then
diff --git a/server/alarm/common.go b/server/alarm/common.go
index 601b2d1..9243d13 100644
--- a/server/alarm/common.go
+++ b/server/alarm/common.go
@@ -27,8 +27,8 @@ const (
 )
 
 const (
-	IdBackendConnectionRefuse model.ID = "BackendConnectionRefuse"
-	IdInternalError           model.ID = "InternalError"
+	IDBackendConnectionRefuse model.ID = "BackendConnectionRefuse"
+	IDInternalError           model.ID = "InternalError"
 )
 
 const (
@@ -67,17 +67,17 @@ func AdditionalContext(format string, args ...interface{}) model.Field {
 }
 
 func ListAll() []*model.AlarmEvent {
-	return AlarmCenter().ListAll()
+	return Center().ListAll()
 }
 
 func Raise(id model.ID, fields ...model.Field) error {
-	return AlarmCenter().Raise(id, fields...)
+	return Center().Raise(id, fields...)
 }
 
 func Clear(id model.ID) error {
-	return AlarmCenter().Clear(id)
+	return Center().Clear(id)
 }
 
 func ClearAll() {
-	AlarmCenter().ClearAll()
+	Center().ClearAll()
 }
diff --git a/server/alarm/model/types.go b/server/alarm/model/types.go
index 86ca809..0c29d79 100644
--- a/server/alarm/model/types.go
+++ b/server/alarm/model/types.go
@@ -32,7 +32,7 @@ type Field struct {
 type AlarmEvent struct {
 	nf.Event `json:"-"`
 	Status   Status          `json:"status"`
-	Id       ID              `json:"id"`
+	ID       ID              `json:"id"`
 	Fields   util.JSONObject `json:"fields,omitempty"`
 }
 
diff --git a/server/alarm/service.go b/server/alarm/service.go
index ee00713..e399b91 100644
--- a/server/alarm/service.go
+++ b/server/alarm/service.go
@@ -25,38 +25,38 @@ import (
 )
 
 var (
-	service *AlarmService
+	service *Service
 	once    sync.Once
 )
 
-type AlarmService struct {
+type Service struct {
 	nf.Subscriber
 	alarms util.ConcurrentMap
 }
 
-func (ac *AlarmService) Raise(id model.ID, fields ...model.Field) error {
+func (ac *Service) Raise(id model.ID, fields ...model.Field) error {
 	ae := &model.AlarmEvent{
 		Event:  nf.NewEvent(ALARM, Subject, ""),
 		Status: Activated,
-		Id:     id,
+		ID:     id,
 		Fields: util.NewJSONObject(),
 	}
 	for _, f := range fields {
 		ae.Fields[f.Key] = f.Value
 	}
-	return notify.NotifyCenter().Publish(ae)
+	return notify.GetNotifyCenter().Publish(ae)
 }
 
-func (ac *AlarmService) Clear(id model.ID) error {
+func (ac *Service) Clear(id model.ID) error {
 	ae := &model.AlarmEvent{
 		Event:  nf.NewEvent(ALARM, Subject, ""),
 		Status: Cleared,
-		Id:     id,
+		ID:     id,
 	}
-	return notify.NotifyCenter().Publish(ae)
+	return notify.GetNotifyCenter().Publish(ae)
 }
 
-func (ac *AlarmService) ListAll() (ls []*model.AlarmEvent) {
+func (ac *Service) ListAll() (ls []*model.AlarmEvent) {
 	ac.alarms.ForEach(func(item util.MapItem) (next bool) {
 		ls = append(ls, item.Value.(*model.AlarmEvent))
 		return true
@@ -64,36 +64,38 @@ func (ac *AlarmService) ListAll() (ls []*model.AlarmEvent) {
 	return
 }
 
-func (ac *AlarmService) ClearAll() {
+func (ac *Service) ClearAll() {
 	ac.alarms = util.ConcurrentMap{}
-	return
 }
 
-func (ac *AlarmService) OnMessage(evt nf.Event) {
+func (ac *Service) OnMessage(evt nf.Event) {
 	alarm := evt.(*model.AlarmEvent)
 	switch alarm.Status {
 	case Cleared:
-		if itf, ok := ac.alarms.Get(alarm.Id); ok {
+		if itf, ok := ac.alarms.Get(alarm.ID); ok {
 			if exist := itf.(*model.AlarmEvent); exist.Status != Cleared {
 				exist.Status = Cleared
 				alarm = exist
 			}
 		}
 	default:
-		ac.alarms.Put(alarm.Id, alarm)
+		ac.alarms.Put(alarm.ID, alarm)
 	}
-	log.Debugf("alarm[%s] %s, %v", alarm.Id, alarm.Status, alarm.Fields)
+	log.Debugf("alarm[%s] %s, %v", alarm.ID, alarm.Status, alarm.Fields)
 }
 
-func NewAlarmService() *AlarmService {
-	c := &AlarmService{
+func NewAlarmService() *Service {
+	c := &Service{
 		Subscriber: nf.NewSubscriber(ALARM, Subject, Group),
 	}
-	notify.NotifyCenter().AddSubscriber(c)
+	err := notify.GetNotifyCenter().AddSubscriber(c)
+	if err != nil {
+		log.Error("", err)
+	}
 	return c
 }
 
-func AlarmCenter() *AlarmService {
+func Center() *Service {
 	once.Do(func() {
 		service = NewAlarmService()
 	})
diff --git a/server/api.go b/server/api.go
index 8811f98..aabee30 100644
--- a/server/api.go
+++ b/server/api.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package server
 
 import (
@@ -193,7 +194,7 @@ func (s *APIServer) Start() {
 	}
 
 	// 自注册
-	err = backend.RegistryEngine().Start()
+	err = backend.GetRegistryEngine().Start()
 	if err != nil {
 		s.err <- err
 		return
@@ -207,7 +208,7 @@ func (s *APIServer) Stop() {
 	s.isClose = true
 
 	if !s.forked && core.ServerInfo.Config.SelfRegister {
-		backend.RegistryEngine().Stop()
+		backend.GetRegistryEngine().Stop()
 	}
 
 	if s.restSrv != nil {
diff --git a/server/bootstrap/bootstrap.go b/server/bootstrap/bootstrap.go
index cbff156..847cc8a 100644
--- a/server/bootstrap/bootstrap.go
+++ b/server/bootstrap/bootstrap.go
@@ -16,51 +16,57 @@
  */
 package bootstrap
 
-// rest
+//rest v3 api
 import _ "github.com/apache/servicecomb-service-center/server/rest/controller/v3"
+
+// rest v4 api
 import _ "github.com/apache/servicecomb-service-center/server/rest/controller/v4"
 
-// registry
+//registry is buildin
 import _ "github.com/apache/servicecomb-service-center/server/plugin/registry/buildin"
+
+//registry etcd
 import _ "github.com/apache/servicecomb-service-center/server/plugin/registry/etcd"
+
+//registry etcd
 import _ "github.com/apache/servicecomb-service-center/server/plugin/registry/embededetcd"
 
-// discovery
+//discovery
 import _ "github.com/apache/servicecomb-service-center/server/plugin/discovery/aggregate"
 import _ "github.com/apache/servicecomb-service-center/server/plugin/discovery/servicecenter"
 import _ "github.com/apache/servicecomb-service-center/server/plugin/discovery/etcd"
 import _ "github.com/apache/servicecomb-service-center/server/plugin/discovery/k8s"
 
-// cipher
+//cipher
 import _ "github.com/apache/servicecomb-service-center/server/plugin/security/buildin"
 
-// quota
+//quota
 import _ "github.com/apache/servicecomb-service-center/server/plugin/quota/buildin"
 import _ "github.com/apache/servicecomb-service-center/server/plugin/quota/unlimit"
 
-// auth
+//auth
 import _ "github.com/apache/servicecomb-service-center/server/plugin/auth/buildin"
 
-// uuid
+//uuid
 import _ "github.com/apache/servicecomb-service-center/server/plugin/uuid/buildin"
 import _ "github.com/apache/servicecomb-service-center/server/plugin/uuid/context"
 
-// tracing
+//tracing
 import _ "github.com/apache/servicecomb-service-center/server/plugin/tracing/pzipkin"
 
-// tls
+//tls
 import _ "github.com/apache/servicecomb-service-center/server/plugin/tls/buildin"
 
-// module 'govern'
-import _ "github.com/apache/servicecomb-service-center/server/govern"
+//module 'govern'
+import _ "github.com/apache/servicecomb-service-center/server/rest/govern"
 
-// module 'broker'
+//module 'broker'
 import _ "github.com/apache/servicecomb-service-center/server/broker"
 
-// module 'admin'
-import _ "github.com/apache/servicecomb-service-center/server/admin"
+//module 'admin'
+import _ "github.com/apache/servicecomb-service-center/server/rest/admin"
 
-// metrics
+//metrics
 import _ "github.com/apache/servicecomb-service-center/server/metric"
 
 import (
diff --git a/server/broker/broker.go b/server/broker/broker.go
index 483444a..0889d77 100644
--- a/server/broker/broker.go
+++ b/server/broker/broker.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package broker
 
 import (
@@ -25,5 +26,5 @@ func init() {
 }
 
 func registerREST() {
-	roa.RegisterServant(&BrokerController{})
+	roa.RegisterServant(&Controller{})
 }
diff --git a/server/broker/broker_key_generator.go b/server/broker/broker_key_generator.go
index 1fbdfb2..21ef945 100644
--- a/server/broker/broker_key_generator.go
+++ b/server/broker/broker_key_generator.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package broker
 
 import (
@@ -23,21 +24,21 @@ import (
 )
 
 const (
-	BROKER_ROOT_KEY              = "cse-pact"
-	BROKER_PARTICIPANT_KEY       = "participant"
-	BROKER_VERSION_KEY           = "version"
-	BROKER_PACT_KEY              = "pact"
-	BROKER_PACT_VERSION_KEY      = "pact-version"
-	BROKER_PACT_TAG_KEY          = "pact-tag"
-	BROKER_PACT_VERIFICATION_KEY = "verification"
-	BROKER_PACT_LATEST           = "latest"
+	BrokerRootKey             = "cse-pact"
+	BrokerParticipantKey      = "participant"
+	BrokerVersionKey          = "version"
+	BrokerPactKey             = "pact"
+	BrokerPactVersionKey      = "pact-version"
+	BrokerPactTagKey          = "pact-tag"
+	BrokerPactVerificationKey = "verification"
+	BrokerPactLatest          = "latest"
 )
 
 // GetBrokerRootKey returns url (/cse-pact)
 func GetBrokerRootKey() string {
 	return util.StringJoin([]string{
 		"",
-		BROKER_ROOT_KEY,
+		BrokerRootKey,
 	}, "/")
 }
 
@@ -45,7 +46,7 @@ func GetBrokerRootKey() string {
 func GetBrokerLatestKey(tenant string) string {
 	return util.StringJoin([]string{
 		GetBrokerRootKey(),
-		BROKER_PACT_LATEST,
+		BrokerPactLatest,
 		tenant,
 	}, "/")
 }
@@ -54,16 +55,16 @@ func GetBrokerLatestKey(tenant string) string {
 func GetBrokerParticipantKey(tenant string) string {
 	return util.StringJoin([]string{
 		GetBrokerRootKey(),
-		BROKER_PARTICIPANT_KEY,
+		BrokerParticipantKey,
 		tenant,
 	}, "/")
 }
 
 //GenerateBrokerParticipantKey returns the participant key
-func GenerateBrokerParticipantKey(tenant string, appId string, serviceName string) string {
+func GenerateBrokerParticipantKey(tenant string, appID string, serviceName string) string {
 	return util.StringJoin([]string{
 		GetBrokerParticipantKey(tenant),
-		appId,
+		appID,
 		serviceName,
 	}, "/")
 }
@@ -72,17 +73,17 @@ func GenerateBrokerParticipantKey(tenant string, appId string, serviceName strin
 func GetBrokerVersionKey(tenant string) string {
 	return util.StringJoin([]string{
 		GetBrokerRootKey(),
-		BROKER_VERSION_KEY,
+		BrokerVersionKey,
 		tenant,
 	}, "/")
 }
 
 //GenerateBrokerVersionKey returns the version key
-func GenerateBrokerVersionKey(tenant string, number string, participantId int32) string {
+func GenerateBrokerVersionKey(tenant string, number string, participantID int32) string {
 	return util.StringJoin([]string{
 		GetBrokerVersionKey(tenant),
 		number,
-		strconv.Itoa(int(participantId)),
+		strconv.Itoa(int(participantID)),
 	}, "/")
 }
 
@@ -90,18 +91,18 @@ func GenerateBrokerVersionKey(tenant string, number string, participantId int32)
 func GetBrokerPactKey(tenant string) string {
 	return util.StringJoin([]string{
 		GetBrokerRootKey(),
-		BROKER_PACT_KEY,
+		BrokerPactKey,
 		tenant,
 	}, "/")
 }
 
 //GenerateBrokerPactKey returns the pact key
-func GenerateBrokerPactKey(tenant string, consumerParticipantId int32,
-	providerParticipantId int32, sha []byte) string {
+func GenerateBrokerPactKey(tenant string, consumerParticipantID int32,
+	providerParticipantID int32, sha []byte) string {
 	return util.StringJoin([]string{
 		GetBrokerPactKey(tenant),
-		strconv.Itoa(int(consumerParticipantId)),
-		strconv.Itoa(int(providerParticipantId)),
+		strconv.Itoa(int(consumerParticipantID)),
+		strconv.Itoa(int(providerParticipantID)),
 		string(sha),
 	}, "/")
 }
@@ -110,17 +111,17 @@ func GenerateBrokerPactKey(tenant string, consumerParticipantId int32,
 func GetBrokerPactVersionKey(tenant string) string {
 	return util.StringJoin([]string{
 		GetBrokerRootKey(),
-		BROKER_PACT_VERSION_KEY,
+		BrokerPactVersionKey,
 		tenant,
 	}, "/")
 }
 
 //GenerateBrokerPactVersionKey returns the pact version root key
-func GenerateBrokerPactVersionKey(tenant string, versionId int32, pactId int32) string {
+func GenerateBrokerPactVersionKey(tenant string, versionID int32, pactID int32) string {
 	return util.StringJoin([]string{
 		GetBrokerPactVersionKey(tenant),
-		strconv.Itoa(int(versionId)),
-		strconv.Itoa(int(pactId)),
+		strconv.Itoa(int(versionID)),
+		strconv.Itoa(int(pactID)),
 	}, "/")
 }
 
@@ -128,16 +129,16 @@ func GenerateBrokerPactVersionKey(tenant string, versionId int32, pactId int32)
 func GetBrokerTagKey(tenant string) string {
 	return util.StringJoin([]string{
 		GetBrokerRootKey(),
-		BROKER_PACT_TAG_KEY,
+		BrokerPactTagKey,
 		tenant,
 	}, "/")
 }
 
 //GenerateBrokerTagKey returns the broker tag key
-func GenerateBrokerTagKey(tenant string, versionId int32) string {
+func GenerateBrokerTagKey(tenant string, versionID int32) string {
 	return util.StringJoin([]string{
 		GetBrokerTagKey(tenant),
-		strconv.Itoa(int(versionId)),
+		strconv.Itoa(int(versionID)),
 	}, "/")
 }
 
@@ -145,16 +146,16 @@ func GenerateBrokerTagKey(tenant string, versionId int32) string {
 func GetBrokerVerificationKey(tenant string) string {
 	return util.StringJoin([]string{
 		GetBrokerRootKey(),
-		BROKER_PACT_VERIFICATION_KEY,
+		BrokerPactVerificationKey,
 		tenant,
 	}, "/")
 }
 
 //GenerateBrokerVerificationKey returns he verification key
-func GenerateBrokerVerificationKey(tenant string, pactVersionId int32, number int32) string {
+func GenerateBrokerVerificationKey(tenant string, pactVersionID int32, number int32) string {
 	return util.StringJoin([]string{
 		GetBrokerVerificationKey(tenant),
-		strconv.Itoa(int(pactVersionId)),
+		strconv.Itoa(int(pactVersionID)),
 		strconv.Itoa(int(number)),
 	}, "/")
 }
@@ -163,7 +164,7 @@ func GenerateBrokerVerificationKey(tenant string, pactVersionId int32, number in
 func GetBrokerLatestParticipantIDKey() string {
 	return util.StringJoin([]string{
 		GetBrokerLatestKey("default"),
-		BROKER_PARTICIPANT_KEY,
+		BrokerParticipantKey,
 	}, "/")
 }
 
@@ -171,7 +172,7 @@ func GetBrokerLatestParticipantIDKey() string {
 func GetBrokerLatestVersionIDKey() string {
 	return util.StringJoin([]string{
 		GetBrokerLatestKey("default"),
-		BROKER_VERSION_KEY,
+		BrokerVersionKey,
 	}, "/")
 }
 
@@ -179,7 +180,7 @@ func GetBrokerLatestVersionIDKey() string {
 func GetBrokerLatestPactIDKey() string {
 	return util.StringJoin([]string{
 		GetBrokerLatestKey("default"),
-		BROKER_PACT_KEY,
+		BrokerPactKey,
 	}, "/")
 }
 
@@ -187,7 +188,7 @@ func GetBrokerLatestPactIDKey() string {
 func GetBrokerLatestPactVersionIDKey() string {
 	return util.StringJoin([]string{
 		GetBrokerLatestKey("default"),
-		BROKER_PACT_VERSION_KEY,
+		BrokerPactVersionKey,
 	}, "/")
 }
 
@@ -195,6 +196,6 @@ func GetBrokerLatestPactVersionIDKey() string {
 func GetBrokerLatestVerificationIDKey() string {
 	return util.StringJoin([]string{
 		GetBrokerLatestKey("default"),
-		BROKER_PACT_VERIFICATION_KEY,
+		BrokerPactVerificationKey,
 	}, "/")
 }
diff --git a/server/broker/broker_suite_test.go b/server/broker/broker_suite_test.go
index 7747d98..24a5341 100644
--- a/server/broker/broker_suite_test.go
+++ b/server/broker/broker_suite_test.go
@@ -34,7 +34,7 @@ func init() {
 	core.Initialize()
 }
 
-var brokerResource = broker.BrokerServiceAPI
+var brokerResource = broker.ServiceAPI
 
 var _ = BeforeSuite(func() {
 	//init plugin
diff --git a/server/broker/controller.go b/server/broker/controller.go
index 3437172..19c1ef3 100644
--- a/server/broker/controller.go
+++ b/server/broker/controller.go
@@ -14,10 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package broker
 
 import (
 	"encoding/json"
+	"github.com/apache/servicecomb-service-center/pkg/log"
 	"io/ioutil"
 	"net/http"
 	"strconv"
@@ -28,51 +30,51 @@ import (
 	scerr "github.com/apache/servicecomb-service-center/server/scerror"
 )
 
-const DEFAULT_SCHEME = "http"
+const DefaultScheme = "http"
 
-type BrokerController struct {
+type Controller struct {
 }
 
-func (brokerService *BrokerController) URLPatterns() []rest.Route {
+func (brokerService *Controller) URLPatterns() []rest.Route {
 	return []rest.Route{
 		// for handling broker requests
-		{rest.HTTP_METHOD_GET,
-			"/",
-			brokerService.GetHome},
-		{rest.HTTP_METHOD_PUT,
-			"/pacts/provider/:providerId/consumer/:consumerId/version/:number",
-			brokerService.PublishPact},
-		{rest.HTTP_METHOD_GET,
-			"/pacts/provider/:providerId/latest",
-			brokerService.GetAllProviderPacts},
-		{rest.HTTP_METHOD_GET,
-			"/pacts/provider/:providerId/consumer/:consumerId/version/:number",
-			brokerService.GetPactsOfProvider},
-		{rest.HTTP_METHOD_DELETE,
-			"/pacts/delete",
-			brokerService.DeletePacts},
-		{rest.HTTP_METHOD_POST,
-			"/pacts/provider/:providerId/consumer/:consumerId/pact-version/:sha/verification-results",
-			brokerService.PublishVerificationResults},
-		{rest.HTTP_METHOD_GET,
-			"/verification-results/consumer/:consumerId/version/:consumerVersion/latest",
-			brokerService.RetrieveVerificationResults},
+		{Method: http.MethodGet,
+			Path: "/",
+			Func: brokerService.GetHome},
+		{Method: rest.HTTPMethodPut,
+			Path: "/pacts/provider/:providerId/consumer/:consumerId/version/:number",
+			Func: brokerService.PublishPact},
+		{Method: http.MethodGet,
+			Path: "/pacts/provider/:providerId/latest",
+			Func: brokerService.GetAllProviderPacts},
+		{Method: http.MethodGet,
+			Path: "/pacts/provider/:providerId/consumer/:consumerId/version/:number",
+			Func: brokerService.GetPactsOfProvider},
+		{Method: rest.HTTPMethodDelete,
+			Path: "/pacts/delete",
+			Func: brokerService.DeletePacts},
+		{Method: rest.HTTPMethodPost,
+			Path: "/pacts/provider/:providerId/consumer/:consumerId/pact-version/:sha/verification-results",
+			Func: brokerService.PublishVerificationResults},
+		{Method: http.MethodGet,
+			Path: "/verification-results/consumer/:consumerId/version/:consumerVersion/latest",
+			Func: brokerService.RetrieveVerificationResults},
 	}
 }
 
-func (brokerService *BrokerController) GetHome(w http.ResponseWriter, r *http.Request) {
+func (brokerService *Controller) GetHome(w http.ResponseWriter, r *http.Request) {
 	request := &brokerpb.BaseBrokerRequest{
 		HostAddress: r.Host,
 		Scheme:      getScheme(r),
 	}
-	resp, _ := BrokerServiceAPI.GetBrokerHome(r.Context(), request)
+	resp, _ := ServiceAPI.GetBrokerHome(r.Context(), request)
 
 	respInternal := resp.Response
 	resp.Response = nil
 	controller.WriteResponse(w, respInternal, resp)
 }
 
-func (*BrokerController) PublishPact(w http.ResponseWriter, r *http.Request) {
+func (*Controller) PublishPact(w http.ResponseWriter, r *http.Request) {
 	message, err := ioutil.ReadAll(r.Body)
 	if err != nil {
 		PactLogger.Error("body err\n", err)
@@ -88,14 +90,18 @@ func (*BrokerController) PublishPact(w http.ResponseWriter, r *http.Request) {
 	}
 	PactLogger.Infof("PublishPact: providerId = %s, consumerId = %s, version = %s\n",
 		request.ProviderId, request.ConsumerId, request.Version)
-	resp, err := BrokerServiceAPI.PublishPact(r.Context(), request)
-
+	resp, err := ServiceAPI.PublishPact(r.Context(), request)
+	if err != nil {
+		log.Errorf(err, "can not push pact")
+		controller.WriteError(w, scerr.ErrInternal, "can not push pact")
+		return
+	}
 	respInternal := resp.Response
 	resp.Response = nil
 	controller.WriteResponse(w, respInternal, resp)
 }
 
-func (*BrokerController) GetAllProviderPacts(w http.ResponseWriter, r *http.Request) {
+func (*Controller) GetAllProviderPacts(w http.ResponseWriter, r *http.Request) {
 	request := &brokerpb.GetAllProviderPactsRequest{
 		ProviderId: r.URL.Query().Get(":providerId"),
 		BaseUrl: &brokerpb.BaseBrokerRequest{
@@ -103,7 +109,12 @@ func (*BrokerController) GetAllProviderPacts(w http.ResponseWriter, r *http.Requ
 			Scheme:      getScheme(r),
 		},
 	}
-	resp, err := BrokerServiceAPI.GetAllProviderPacts(r.Context(), request /*, href*/)
+	resp, err := ServiceAPI.GetAllProviderPacts(r.Context(), request /*, href*/)
+	if err != nil {
+		PactLogger.Errorf(err, "can not get pacts")
+		controller.WriteError(w, scerr.ErrInternal, "can not get pacts")
+		return
+	}
 	linksObj, err := json.Marshal(resp)
 	if err != nil {
 		PactLogger.Errorf(err, "invalid ProviderPacts")
@@ -116,7 +127,7 @@ func (*BrokerController) GetAllProviderPacts(w http.ResponseWriter, r *http.Requ
 	controller.WriteResponse(w, respInternal, resp)
 }
 
-func (*BrokerController) GetPactsOfProvider(w http.ResponseWriter, r *http.Request) {
+func (*Controller) GetPactsOfProvider(w http.ResponseWriter, r *http.Request) {
 	query := r.URL.Query()
 	request := &brokerpb.GetProviderConsumerVersionPactRequest{
 		ProviderId: query.Get(":providerId"),
@@ -128,22 +139,22 @@ func (*BrokerController) GetPactsOfProvider(w http.ResponseWriter, r *http.Reque
 		},
 	}
 
-	resp, _ := BrokerServiceAPI.GetPactsOfProvider(r.Context(), request)
+	resp, _ := ServiceAPI.GetPactsOfProvider(r.Context(), request)
 	respInternal := resp.Response
 	resp.Response = nil
 	//controller.WriteResponse(w, respInternal, resp.Pact)
-	controller.WriteJsonIfSuccess(w, respInternal, resp.Pact)
+	controller.WriteJSONIfSuccess(w, respInternal, resp.Pact)
 }
 
-func (*BrokerController) DeletePacts(w http.ResponseWriter, r *http.Request) {
-	resp, _ := BrokerServiceAPI.DeletePacts(r.Context(), &brokerpb.BaseBrokerRequest{
+func (*Controller) DeletePacts(w http.ResponseWriter, r *http.Request) {
+	resp, _ := ServiceAPI.DeletePacts(r.Context(), &brokerpb.BaseBrokerRequest{
 		HostAddress: r.Host,
 		Scheme:      getScheme(r),
 	})
 	controller.WriteResponse(w, resp, nil)
 }
 
-func (*BrokerController) PublishVerificationResults(w http.ResponseWriter, r *http.Request) {
+func (*Controller) PublishVerificationResults(w http.ResponseWriter, r *http.Request) {
 	requestBody, err := ioutil.ReadAll(r.Body)
 	if err != nil {
 		PactLogger.Error("body err", err)
@@ -170,21 +181,26 @@ func (*BrokerController) PublishVerificationResults(w http.ResponseWriter, r *ht
 	PactLogger.Infof("PublishVerificationResults: %s, %s, %d, %t, %s\n",
 		request.ProviderId, request.ConsumerId, request.PactId, request.Success,
 		request.ProviderApplicationVersion)
-	resp, err := BrokerServiceAPI.PublishVerificationResults(r.Context(),
+	resp, err := ServiceAPI.PublishVerificationResults(r.Context(),
 		request)
+	if err != nil {
+		PactLogger.Error("publish failed", err)
+		controller.WriteError(w, scerr.ErrInternal, "publish failed")
+		return
+	}
 	respInternal := resp.Response
 	resp.Response = nil
 	controller.WriteResponse(w, respInternal, resp)
 }
 
-func (*BrokerController) RetrieveVerificationResults(w http.ResponseWriter, r *http.Request) {
+func (*Controller) RetrieveVerificationResults(w http.ResponseWriter, r *http.Request) {
 	request := &brokerpb.RetrieveVerificationRequest{}
 	query := r.URL.Query()
 	request.ConsumerId = query.Get(":consumerId")
 	request.ConsumerVersion = query.Get(":consumerVersion")
 	PactLogger.Infof("Retrieve verification results for: %s, %s\n",
 		request.ConsumerId, request.ConsumerVersion)
-	resp, _ := BrokerServiceAPI.RetrieveVerificationResults(r.Context(), request)
+	resp, _ := ServiceAPI.RetrieveVerificationResults(r.Context(), request)
 	respInternal := resp.Response
 	resp.Response = nil
 	controller.WriteResponse(w, respInternal, resp)
@@ -192,7 +208,7 @@ func (*BrokerController) RetrieveVerificationResults(w http.ResponseWriter, r *h
 
 func getScheme(r *http.Request) string {
 	if len(r.URL.Scheme) < 1 {
-		return DEFAULT_SCHEME
+		return DefaultScheme
 	}
 	return r.URL.Scheme
 }
diff --git a/server/broker/controller_test.go b/server/broker/controller_test.go
index fe42bf4..5f12fed 100644
--- a/server/broker/controller_test.go
+++ b/server/broker/controller_test.go
@@ -24,7 +24,7 @@ import (
 )
 
 var (
-	ctrl = &BrokerController{}
+	ctrl = &Controller{}
 	num  int
 )
 
diff --git a/server/broker/service.go b/server/broker/service.go
index 2453e87..ed8615f 100644
--- a/server/broker/service.go
+++ b/server/broker/service.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package broker
 
 import (
@@ -35,12 +36,12 @@ import (
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
 )
 
-var BrokerServiceAPI = &BrokerService{}
+var ServiceAPI = &Service{}
 
-type BrokerService struct {
+type Service struct {
 }
 
-func (*BrokerService) GetBrokerHome(ctx context.Context,
+func (*Service) GetBrokerHome(ctx context.Context,
 	in *brokerpb.BaseBrokerRequest) (*brokerpb.BrokerHomeResponse, error) {
 
 	if in == nil || len(in.HostAddress) == 0 {
@@ -53,13 +54,13 @@ func (*BrokerService) GetBrokerHome(ctx context.Context,
 	return GetBrokerHomeResponse(in.HostAddress, in.Scheme), nil
 }
 
-func (*BrokerService) GetPactsOfProvider(ctx context.Context,
+func (*Service) GetPactsOfProvider(ctx context.Context,
 	in *brokerpb.GetProviderConsumerVersionPactRequest) (*brokerpb.GetProviderConsumerVersionPactResponse, error) {
 	PactLogger.Infof("GetPactsOfProvider: (%s, %s, %s)\n",
 		in.ProviderId, in.ConsumerId, in.Version)
 
-	resp, pactId, err := RetrieveProviderConsumerPact(ctx, in)
-	if err != nil || resp.GetPact() == nil || pactId == -1 {
+	resp, pactID, err := RetrieveProviderConsumerPact(ctx, in)
+	if err != nil || resp.GetPact() == nil || pactID == -1 {
 		var message string
 		if resp != nil {
 			message = resp.Response.Message
@@ -71,10 +72,10 @@ func (*BrokerService) GetPactsOfProvider(ctx context.Context,
 	}
 
 	urlValue := GenerateBrokerAPIPath(in.BaseUrl.Scheme, in.BaseUrl.HostAddress,
-		BROKER_PUBLISH_VERIFICATION_URL,
+		PublishVerificationURL,
 		strings.NewReplacer(":providerId", in.ProviderId,
-			":consumerId", in.ConsumerId,
-			":pact", strconv.FormatInt(int64(pactId), 10)))
+			":consumerID", in.ConsumerId,
+			":pact", strconv.FormatInt(int64(pactID), 10)))
 
 	links := ",\"_links\": {" +
 		"\"pb:publish-verification-results\": {" +
@@ -97,7 +98,7 @@ func (*BrokerService) GetPactsOfProvider(ctx context.Context,
 
 }
 
-func (*BrokerService) DeletePacts(ctx context.Context,
+func (*Service) DeletePacts(ctx context.Context,
 	in *brokerpb.BaseBrokerRequest) (*pb.Response, error) {
 
 	resp, err := DeletePactData(ctx, in)
@@ -105,7 +106,7 @@ func (*BrokerService) DeletePacts(ctx context.Context,
 	return resp, err
 }
 
-func (*BrokerService) RetrieveProviderPacts(ctx context.Context,
+func (*Service) RetrieveProviderPacts(ctx context.Context,
 	in *brokerpb.GetAllProviderPactsRequest) (*brokerpb.GetAllProviderPactsResponse, error) {
 	if in == nil || len(in.ProviderId) == 0 {
 		PactLogger.Errorf(nil, "all provider pact retrieve request failed: invalid params.")
@@ -219,7 +220,7 @@ func (*BrokerService) RetrieveProviderPacts(ctx context.Context,
 		}
 		PactLogger.Infof("[RetrieveProviderPacts] Consumer found: (%d, %s, %s)", participant.Id, participant.AppId, participant.ServiceName)
 		consumerVersion := participantToVersionObj[participant.Id].Number
-		consumerId, err := serviceUtil.GetServiceId(ctx, &pb.MicroServiceKey{
+		consumerID, err := serviceUtil.GetServiceID(ctx, &pb.MicroServiceKey{
 			Tenant:      tenant,
 			AppId:       participant.AppId,
 			ServiceName: participant.ServiceName,
@@ -228,28 +229,28 @@ func (*BrokerService) RetrieveProviderPacts(ctx context.Context,
 		if err != nil {
 			return nil, err
 		}
-		PactLogger.Infof("[RetrieveProviderPacts] Consumer microservice found: %s", consumerId)
+		PactLogger.Infof("[RetrieveProviderPacts] Consumer microservice found: %s", consumerID)
 
 		urlValue := GenerateBrokerAPIPath(in.BaseUrl.Scheme, in.BaseUrl.HostAddress,
-			BROKER_PUBLISH_URL,
+			PublishURL,
 			strings.NewReplacer(":providerId", in.ProviderId,
-				":consumerId", consumerId,
+				":consumerID", consumerID,
 				":number", consumerVersion))
 
 		consumerInfo := &brokerpb.ConsumerInfo{
 			Href: urlValue,
-			Name: consumerId,
+			Name: consumerID,
 		}
 		consumerInfoArr = append(consumerInfoArr, consumerInfo)
 	}
 	links := &brokerpb.Links{
 		Pacts: consumerInfoArr,
 	}
-	resJson, err := json.Marshal(links)
+	resJSON, err := json.Marshal(links)
 	if err != nil {
 		return nil, err
 	}
-	PactLogger.Infof("Json : %s", string(resJson))
+	PactLogger.Infof("Json : %s", string(resJSON))
 	response := &brokerpb.GetAllProviderPactsResponse{
 		Response: pb.CreateResponse(pb.Response_SUCCESS, "retrieve provider pact info succeeded."),
 		XLinks:   links,
@@ -257,7 +258,7 @@ func (*BrokerService) RetrieveProviderPacts(ctx context.Context,
 	return response, nil
 }
 
-func (*BrokerService) GetAllProviderPacts(ctx context.Context,
+func (*Service) GetAllProviderPacts(ctx context.Context,
 	in *brokerpb.GetAllProviderPactsRequest) (*brokerpb.GetAllProviderPactsResponse, error) {
 
 	if in == nil || len(in.ProviderId) == 0 {
@@ -372,7 +373,7 @@ func (*BrokerService) GetAllProviderPacts(ctx context.Context,
 		}
 		PactLogger.Infof("[RetrieveProviderPacts] Consumer found: (%d, %s, %s)", participant.Id, participant.AppId, participant.ServiceName)
 		consumerVersion := participantToVersionObj[participant.Id].Number
-		consumerId, err := serviceUtil.GetServiceId(ctx, &pb.MicroServiceKey{
+		consumerID, err := serviceUtil.GetServiceID(ctx, &pb.MicroServiceKey{
 			Tenant:      tenant,
 			AppId:       participant.AppId,
 			ServiceName: participant.ServiceName,
@@ -381,28 +382,28 @@ func (*BrokerService) GetAllProviderPacts(ctx context.Context,
 		if err != nil {
 			return nil, err
 		}
-		PactLogger.Infof("[RetrieveProviderPacts] Consumer microservice found: %s", consumerId)
+		PactLogger.Infof("[RetrieveProviderPacts] Consumer microservice found: %s", consumerID)
 
 		urlValue := GenerateBrokerAPIPath(in.BaseUrl.Scheme, in.BaseUrl.HostAddress,
-			BROKER_PUBLISH_URL,
+			PublishURL,
 			strings.NewReplacer(":providerId", in.ProviderId,
-				":consumerId", consumerId,
+				":consumerID", consumerID,
 				":number", consumerVersion))
 
 		consumerInfo := &brokerpb.ConsumerInfo{
 			Href: urlValue,
-			Name: consumerId,
+			Name: consumerID,
 		}
 		consumerInfoArr = append(consumerInfoArr, consumerInfo)
 	}
 	links := &brokerpb.Links{
 		Pacts: consumerInfoArr,
 	}
-	resJson, err := json.Marshal(links)
+	resJSON, err := json.Marshal(links)
 	if err != nil {
 		return nil, err
 	}
-	PactLogger.Infof("Json : %s", string(resJson))
+	PactLogger.Infof("Json : %s", string(resJSON))
 	response := &brokerpb.GetAllProviderPactsResponse{
 		Response: pb.CreateResponse(pb.Response_SUCCESS, "retrieve provider pact info succeeded."),
 		XLinks:   links,
@@ -410,7 +411,7 @@ func (*BrokerService) GetAllProviderPacts(ctx context.Context,
 	return response, nil
 }
 
-func (*BrokerService) RetrieveVerificationResults(ctx context.Context, in *brokerpb.RetrieveVerificationRequest) (*brokerpb.RetrieveVerificationResponse, error) {
+func (*Service) RetrieveVerificationResults(ctx context.Context, in *brokerpb.RetrieveVerificationRequest) (*brokerpb.RetrieveVerificationResponse, error) {
 	if in == nil || len(in.ConsumerId) == 0 || len(in.ConsumerVersion) == 0 {
 		PactLogger.Errorf(nil, "verification result retrieve request failed: invalid params.")
 		return &brokerpb.RetrieveVerificationResponse{
@@ -420,13 +421,13 @@ func (*BrokerService) RetrieveVerificationResults(ctx context.Context, in *broke
 	tenant := GetDefaultTenantProject()
 	consumer, err := serviceUtil.GetService(ctx, tenant, in.ConsumerId)
 	if err != nil {
-		PactLogger.Errorf(err, "verification result retrieve request failed, consumerId is %s: query consumer failed.", in.ConsumerId)
+		PactLogger.Errorf(err, "verification result retrieve request failed, consumerID is %s: query consumer failed.", in.ConsumerId)
 		return &brokerpb.RetrieveVerificationResponse{
 			Response: pb.CreateResponse(scerr.ErrInvalidParams, "Query consumer failed."),
 		}, err
 	}
 	if consumer == nil {
-		PactLogger.Errorf(nil, "verification result retrieve request failed, consumerId is %s: consumer not exist.", in.ConsumerId)
+		PactLogger.Errorf(nil, "verification result retrieve request failed, consumerID is %s: consumer not exist.", in.ConsumerId)
 		return &brokerpb.RetrieveVerificationResponse{
 			Response: pb.CreateResponse(scerr.ErrInvalidParams, "Consumer does not exist."),
 		}, nil
@@ -568,7 +569,7 @@ func (*BrokerService) RetrieveVerificationResults(ctx context.Context, in *broke
 			VerificationDate:           lastVerificationResult.VerificationDate,
 		}
 		verificationDetailsArr = append(verificationDetailsArr, verificationDetail)
-		if verificationDetail.Success == true {
+		if verificationDetail.Success {
 			successfuls = append(successfuls, providerName)
 		} else {
 			fails = append(fails, providerName)
@@ -585,7 +586,7 @@ func (*BrokerService) RetrieveVerificationResults(ctx context.Context, in *broke
 	}, nil
 }
 
-func (*BrokerService) PublishVerificationResults(ctx context.Context, in *brokerpb.PublishVerificationRequest) (*brokerpb.PublishVerificationResponse, error) {
+func (*Service) PublishVerificationResults(ctx context.Context, in *brokerpb.PublishVerificationRequest) (*brokerpb.PublishVerificationResponse, error) {
 	if in == nil || len(in.ProviderId) == 0 || len(in.ConsumerId) == 0 {
 		PactLogger.Errorf(nil, "verification result publish request failed: invalid params.")
 		return &brokerpb.PublishVerificationResponse{
@@ -595,13 +596,13 @@ func (*BrokerService) PublishVerificationResults(ctx context.Context, in *broker
 	tenant := GetDefaultTenantProject()
 	consumer, err := serviceUtil.GetService(ctx, tenant, in.ConsumerId)
 	if err != nil {
-		PactLogger.Errorf(err, "verification result publish request failed, consumerId is %s: query consumer failed.", in.ConsumerId)
+		PactLogger.Errorf(err, "verification result publish request failed, consumerID is %s: query consumer failed.", in.ConsumerId)
 		return &brokerpb.PublishVerificationResponse{
 			Response: pb.CreateResponse(scerr.ErrInvalidParams, "Query consumer failed."),
 		}, err
 	}
 	if consumer == nil {
-		PactLogger.Errorf(nil, "verification result publish request failed, consumerId is %s: consumer not exist.", in.ConsumerId)
+		PactLogger.Errorf(nil, "verification result publish request failed, consumerID is %s: consumer not exist.", in.ConsumerId)
 		return &brokerpb.PublishVerificationResponse{
 			Response: pb.CreateResponse(scerr.ErrInvalidParams, "Consumer does not exist."),
 		}, nil
@@ -650,7 +651,7 @@ func (*BrokerService) PublishVerificationResults(ctx context.Context, in *broker
 			pactExists = true
 		}
 	}
-	if pactExists == false {
+	if !pactExists {
 		PactLogger.Errorf(nil, "verification result publish request failed, pact does not exists.")
 		return &brokerpb.PublishVerificationResponse{
 			Response: pb.CreateResponse(scerr.ErrInvalidParams, "pact does not exists."),
@@ -713,7 +714,7 @@ func (*BrokerService) PublishVerificationResults(ctx context.Context, in *broker
 		BuildUrl:         "",
 		VerificationDate: verificationDate,
 	}
-	response, err := CreateVerification(PactLogger, ctx, verificationKey, *verification)
+	response, err := CreateVerification(ctx, verificationKey, *verification)
 	if err != nil {
 		return response, err
 	}
@@ -733,8 +734,8 @@ func (*BrokerService) PublishVerificationResults(ctx context.Context, in *broker
 	}, nil
 }
 
-func (*BrokerService) PublishPact(ctx context.Context, in *brokerpb.PublishPactRequest) (*brokerpb.PublishPactResponse, error) {
-	if in == nil || len(in.ProviderId) == 0 || len(in.ConsumerId) == 0 || len(in.Version) == 0 || len(in.Pact) == 0 {
+func (*Service) PublishPact(ctx context.Context, in *brokerpb.PublishPactRequest) (*brokerpb.PublishPactResponse, error) {
+	if InvalidInput(in) {
 		PactLogger.Errorf(nil, "pact publish request failed: invalid params.")
 		return &brokerpb.PublishPactResponse{
 			Response: pb.CreateResponse(scerr.ErrInvalidParams, "Request format invalid."),
@@ -758,13 +759,13 @@ func (*BrokerService) PublishPact(ctx context.Context, in *brokerpb.PublishPactR
 	PactLogger.Infof("Provider service found: (%s, %s, %s, %s)", provider.ServiceId, provider.AppId, provider.ServiceName, provider.Version)
 	consumer, err := serviceUtil.GetService(ctx, tenant, in.ConsumerId)
 	if err != nil {
-		PactLogger.Errorf(err, "pact publish failed, consumerId is %s: query consumer failed.", in.ConsumerId)
+		PactLogger.Errorf(err, "pact publish failed, consumerID is %s: query consumer failed.", in.ConsumerId)
 		return &brokerpb.PublishPactResponse{
 			Response: pb.CreateResponse(scerr.ErrInvalidParams, "Query consumer failed."),
 		}, err
 	}
 	if consumer == nil {
-		PactLogger.Errorf(nil, "pact publish failed, consumerId is %s: consumer not exist.", in.ConsumerId)
+		PactLogger.Errorf(nil, "pact publish failed, consumerID is %s: consumer not exist.", in.ConsumerId)
 		return &brokerpb.PublishPactResponse{
 			Response: pb.CreateResponse(scerr.ErrInvalidParams, "Consumer does not exist."),
 		}, nil
@@ -797,7 +798,7 @@ func (*BrokerService) PublishPact(ctx context.Context, in *brokerpb.PublishPactR
 			}, err
 		}
 		providerParticipant = &brokerpb.Participant{Id: int32(id) + 1, AppId: provider.AppId, ServiceName: provider.ServiceName}
-		response, err := CreateParticipant(PactLogger, ctx, providerParticipantKey, *providerParticipant)
+		response, err := CreateParticipant(ctx, providerParticipantKey, *providerParticipant)
 		if err != nil {
 			return response, err
 		}
@@ -820,7 +821,7 @@ func (*BrokerService) PublishPact(ctx context.Context, in *brokerpb.PublishPactR
 			}, err
 		}
 		consumerParticipant = &brokerpb.Participant{Id: int32(id) + 1, AppId: consumer.AppId, ServiceName: consumer.ServiceName}
-		response, err := CreateParticipant(PactLogger, ctx, consumerParticipantKey, *consumerParticipant)
+		response, err := CreateParticipant(ctx, consumerParticipantKey, *consumerParticipant)
 		if err != nil {
 			return response, err
 		}
@@ -846,7 +847,7 @@ func (*BrokerService) PublishPact(ctx context.Context, in *brokerpb.PublishPactR
 			}, err
 		}
 		version = &brokerpb.Version{Id: int32(id) + 1, Number: in.Version, ParticipantId: consumerParticipant.Id, Order: order}
-		response, err := CreateVersion(PactLogger, ctx, versionKey, *version)
+		response, err := CreateVersion(ctx, versionKey, *version)
 		if err != nil {
 			return response, err
 		}
@@ -872,7 +873,7 @@ func (*BrokerService) PublishPact(ctx context.Context, in *brokerpb.PublishPactR
 		}
 		pact = &brokerpb.Pact{Id: int32(id) + 1, ConsumerParticipantId: consumerParticipant.Id,
 			ProviderParticipantId: providerParticipant.Id, Sha: sha, Content: in.Pact}
-		response, err := CreatePact(PactLogger, ctx, pactKey, *pact)
+		response, err := CreatePact(ctx, pactKey, *pact)
 		if err != nil {
 			return response, err
 		}
@@ -895,7 +896,7 @@ func (*BrokerService) PublishPact(ctx context.Context, in *brokerpb.PublishPactR
 			}, err
 		}
 		pactVersion = &brokerpb.PactVersion{Id: int32(id) + 1, VersionId: version.Id, PactId: pact.Id, ProviderParticipantId: providerParticipant.Id}
-		response, err := CreatePactVersion(PactLogger, ctx, pactVersionKey, *pactVersion)
+		response, err := CreatePactVersion(ctx, pactVersionKey, *pactVersion)
 		if err != nil {
 			return response, err
 		}
@@ -906,3 +907,7 @@ func (*BrokerService) PublishPact(ctx context.Context, in *brokerpb.PublishPactR
 		Response: pb.CreateResponse(pb.Response_SUCCESS, "Pact published successfully."),
 	}, nil
 }
+
+func InvalidInput(in *brokerpb.PublishPactRequest) bool {
+	return in == nil || len(in.ProviderId) == 0 || len(in.ConsumerId) == 0 || len(in.Version) == 0 || len(in.Pact) == 0
+}
diff --git a/server/broker/service_test.go b/server/broker/service_test.go
index d9c08f8..7e841b7 100644
--- a/server/broker/service_test.go
+++ b/server/broker/service_test.go
@@ -25,7 +25,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/broker/brokerpb"
 	"github.com/apache/servicecomb-service-center/server/core"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
-	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
 )
@@ -46,7 +45,7 @@ const (
 var consumerServiceId string
 var providerServiceId string
 
-var _ = Describe("BrokerController", func() {
+var _ = Describe("Controller", func() {
 	Describe("brokerDependency", func() {
 		Context("normal", func() {
 			It("PublishPact", func() {
@@ -240,6 +239,6 @@ func getContext() context.Context {
 	ctx := context.TODO()
 	ctx = util.SetContext(ctx, "domain", "default")
 	ctx = util.SetContext(ctx, "project", "default")
-	ctx = util.SetContext(ctx, serviceUtil.CTX_NOCACHE, "1")
+	ctx = util.SetContext(ctx, util.CtxNocache, "1")
 	return ctx
 }
diff --git a/server/broker/store.go b/server/broker/store.go
index 69bc516..5f1ffdb 100644
--- a/server/broker/store.go
+++ b/server/broker/store.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package broker
 
 import (
@@ -25,10 +26,10 @@ var (
 	PARTICIPANT  discovery.Type
 	VERSION      discovery.Type
 	PACT         discovery.Type
-	PACT_VERSION discovery.Type
-	PACT_TAG     discovery.Type
+	PactVersion  discovery.Type
+	PactTag      discovery.Type
 	VERIFICATION discovery.Type
-	PACT_LATEST  discovery.Type
+	PactLatest   discovery.Type
 )
 
 var brokerKvStore = &BKvStore{}
@@ -40,13 +41,13 @@ func init() {
 		discovery.Configure().WithPrefix(GetBrokerVersionKey(""))))
 	PACT = backend.Store().MustInstall(backend.NewAddOn("PACT",
 		discovery.Configure().WithPrefix(GetBrokerPactKey(""))))
-	PACT_VERSION = backend.Store().MustInstall(backend.NewAddOn("PACT_VERSION",
+	PactVersion = backend.Store().MustInstall(backend.NewAddOn("PACT_VERSION",
 		discovery.Configure().WithPrefix(GetBrokerPactVersionKey(""))))
-	PACT_TAG = backend.Store().MustInstall(backend.NewAddOn("PACT_TAG",
+	PactTag = backend.Store().MustInstall(backend.NewAddOn("PACT_TAG",
 		discovery.Configure().WithPrefix(GetBrokerTagKey(""))))
 	VERIFICATION = backend.Store().MustInstall(backend.NewAddOn("VERIFICATION",
 		discovery.Configure().WithPrefix(GetBrokerVerificationKey(""))))
-	PACT_LATEST = backend.Store().MustInstall(backend.NewAddOn("PACT_LATEST",
+	PactLatest = backend.Store().MustInstall(backend.NewAddOn("PACT_LATEST",
 		discovery.Configure().WithPrefix(GetBrokerLatestKey(""))))
 }
 
@@ -66,11 +67,11 @@ func (s *BKvStore) Pact() discovery.Indexer {
 }
 
 func (s *BKvStore) PactVersion() discovery.Indexer {
-	return backend.Store().Adaptors(PACT_VERSION)
+	return backend.Store().Adaptors(PactVersion)
 }
 
 func (s *BKvStore) PactTag() discovery.Indexer {
-	return backend.Store().Adaptors(PACT_TAG)
+	return backend.Store().Adaptors(PactTag)
 }
 
 func (s *BKvStore) Verification() discovery.Indexer {
@@ -78,7 +79,7 @@ func (s *BKvStore) Verification() discovery.Indexer {
 }
 
 func (s *BKvStore) PactLatest() discovery.Indexer {
-	return backend.Store().Adaptors(PACT_LATEST)
+	return backend.Store().Adaptors(PactLatest)
 }
 
 func Store() *BKvStore {
diff --git a/server/broker/util.go b/server/broker/util.go
index 3b4ba3f..deaa0eb 100644
--- a/server/broker/util.go
+++ b/server/broker/util.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package broker
 
 import (
@@ -40,32 +41,27 @@ import (
 var PactLogger *log.Logger
 
 const (
-	BROKER_HOME_URL                      = "/"
-	BROKER_PARTICIPANTS_URL              = "/participants"
-	BROKER_PARTICIPANT_URL               = "/participants/:participantId"
-	BROKER_PARTY_VERSIONS_URL            = "/participants/:participantId/versions"
-	BROKER_PARTY_LATEST_VERSION_URL      = "/participants/:participantId/versions/latest"
-	BROKER_PARTY_VERSION_URL             = "/participants/:participantId/versions/:number"
-	BROKER_PROVIDER_URL                  = "/pacts/provider"
-	BROKER_PROVIDER_LATEST_PACTS_URL     = "/pacts/provider/:providerId/latest"
-	BROKER_PROVIDER_LATEST_PACTS_TAG_URL = "/pacts/provider/:providerId/latest/:tag"
-	BROKER_PACTS_LATEST_URL              = "/pacts/latest"
-
-	BROKER_PUBLISH_URL              = "/pacts/provider/:providerId/consumer/:consumerId/version/:number"
-	BROKER_PUBLISH_VERIFICATION_URL = "/pacts/provider/:providerId/consumer/:consumerId/pact-version/:pact/verification-results"
-	BROKER_WEBHOOHS_URL             = "/webhooks"
-
-	BROKER_CURIES_URL = "/doc/:rel"
+	HomeURL                   = "/"
+	ParticipantsURL           = "/participants"
+	ProviderLatestPactsURL    = "/pacts/provider/:providerId/latest"
+	ProviderLatestPactsTagURL = "/pacts/provider/:providerId/latest/:tag"
+	PactsLatestURL            = "/pacts/latest"
+
+	PublishURL             = "/pacts/provider/:providerId/consumer/:consumerId/version/:number"
+	PublishVerificationURL = "/pacts/provider/:providerId/consumer/:consumerId/pact-version/:pact/verification-results"
+	WebhooksURL            = "/webhooks"
+
+	CuriesURL = "/doc/:rel"
 )
 
 var brokerAPILinksValues = map[string]string{
-	"self":                              BROKER_HOME_URL,
-	"pb:publish-pact":                   BROKER_PUBLISH_URL,
-	"pb:latest-pact-versions":           BROKER_PACTS_LATEST_URL,
-	"pb:pacticipants":                   BROKER_PARTICIPANTS_URL,
-	"pb:latest-provider-pacts":          BROKER_PROVIDER_LATEST_PACTS_URL,
-	"pb:latest-provider-pacts-with-tag": BROKER_PROVIDER_LATEST_PACTS_TAG_URL,
-	"pb:webhooks":                       BROKER_WEBHOOHS_URL,
+	"self":                              HomeURL,
+	"pb:publish-pact":                   PublishURL,
+	"pb:latest-pact-versions":           PactsLatestURL,
+	"pb:pacticipants":                   ParticipantsURL,
+	"pb:latest-provider-pacts":          ProviderLatestPactsURL,
+	"pb:latest-provider-pacts-with-tag": ProviderLatestPactsTagURL,
+	"pb:webhooks":                       WebhooksURL,
 }
 
 var brokerAPILinksTempl = map[string]bool{
@@ -132,9 +128,7 @@ func GetBrokerHomeLinksAPIS(scheme string, host string, apiKey string) string {
 
 //CreateBrokerHomeResponse create the templated broker home response
 func CreateBrokerHomeResponse(host string, scheme string) *brokerpb.BrokerHomeResponse {
-
-	var apiEntries map[string]*brokerpb.BrokerAPIInfoEntry
-	apiEntries = make(map[string]*brokerpb.BrokerAPIInfoEntry)
+	apiEntries := make(map[string]*brokerpb.BrokerAPIInfoEntry)
 
 	for k := range brokerAPILinksValues {
 		apiEntries[k] = &brokerpb.BrokerAPIInfoEntry{
@@ -147,7 +141,7 @@ func CreateBrokerHomeResponse(host string, scheme string) *brokerpb.BrokerHomeRe
 	curies := []*brokerpb.BrokerAPIInfoEntry{}
 	curies = append(curies, &brokerpb.BrokerAPIInfoEntry{
 		Name: "pb",
-		Href: GenerateBrokerAPIPath(scheme, host, BROKER_CURIES_URL,
+		Href: GenerateBrokerAPIPath(scheme, host, CuriesURL,
 			strings.NewReplacer(":rel", "{rel}")),
 	})
 
@@ -167,9 +161,9 @@ func GetBrokerHomeResponse(host string, scheme string) *brokerpb.BrokerHomeRespo
 	return brokerResp
 }
 
-func GetParticipant(ctx context.Context, domain string, appId string,
+func GetParticipant(ctx context.Context, domain string, appID string,
 	serviceName string) (*brokerpb.Participant, error) {
-	key := GenerateBrokerParticipantKey(domain, appId, serviceName)
+	key := GenerateBrokerParticipantKey(domain, appID, serviceName)
 	participants, err := Store().Participant().Search(ctx, registry.WithStrKey(key))
 	if err != nil {
 		return nil, err
@@ -188,8 +182,8 @@ func GetParticipant(ctx context.Context, domain string, appId string,
 }
 
 func GetVersion(ctx context.Context, domain string, number string,
-	participantId int32) (*brokerpb.Version, error) {
-	key := GenerateBrokerVersionKey(domain, number, participantId)
+	participantID int32) (*brokerpb.Version, error) {
+	key := GenerateBrokerVersionKey(domain, number, participantID)
 	versions, err := Store().Version().Search(ctx, registry.WithStrKey(key))
 	if err != nil {
 		return nil, err
@@ -206,8 +200,8 @@ func GetVersion(ctx context.Context, domain string, number string,
 	return version, nil
 }
 
-func GetPact(ctx context.Context, domain string, consumerParticipantId int32, producerParticipantId int32, sha []byte) (*brokerpb.Pact, error) {
-	key := GenerateBrokerPactKey(domain, consumerParticipantId, producerParticipantId, sha)
+func GetPact(ctx context.Context, domain string, consumerParticipantID int32, producerParticipantID int32, sha []byte) (*brokerpb.Pact, error) {
+	key := GenerateBrokerPactKey(domain, consumerParticipantID, producerParticipantID, sha)
 	versions, err := Store().Pact().Search(ctx, registry.WithStrKey(key))
 	if err != nil {
 		return nil, err
@@ -224,9 +218,9 @@ func GetPact(ctx context.Context, domain string, consumerParticipantId int32, pr
 	return pact, nil
 }
 
-func GetPactVersion(ctx context.Context, domain string, versionId int32,
-	pactId int32) (*brokerpb.PactVersion, error) {
-	key := GenerateBrokerPactVersionKey(domain, versionId, pactId)
+func GetPactVersion(ctx context.Context, domain string, versionID int32,
+	pactID int32) (*brokerpb.PactVersion, error) {
+	key := GenerateBrokerPactVersionKey(domain, versionID, pactID)
 	versions, err := Store().PactVersion().Search(ctx, registry.WithStrKey(key))
 	if err != nil {
 		return nil, err
@@ -258,7 +252,7 @@ func GetData(ctx context.Context, key string) (int, error) {
 	return id, nil
 }
 
-func CreateParticipant(pactLogger *log.Logger, ctx context.Context, participantKey string, participant brokerpb.Participant) (*brokerpb.PublishPactResponse, error) {
+func CreateParticipant(ctx context.Context, participantKey string, participant brokerpb.Participant) (*brokerpb.PublishPactResponse, error) {
 	data, err := json.Marshal(participant)
 	if err != nil {
 		PactLogger.Errorf(nil, "pact publish failed, participant cannot be created.")
@@ -292,7 +286,7 @@ func CreateParticipant(pactLogger *log.Logger, ctx context.Context, participantK
 	return nil, nil
 }
 
-func CreateVersion(pactLogger *log.Logger, ctx context.Context, versionKey string,
+func CreateVersion(ctx context.Context, versionKey string,
 	version brokerpb.Version) (*brokerpb.PublishPactResponse, error) {
 	data, err := json.Marshal(version)
 	if err != nil {
@@ -325,7 +319,7 @@ func CreateVersion(pactLogger *log.Logger, ctx context.Context, versionKey strin
 	return nil, nil
 }
 
-func CreatePact(pactLogger *log.Logger, ctx context.Context,
+func CreatePact(ctx context.Context,
 	pactKey string, pact brokerpb.Pact) (*brokerpb.PublishPactResponse, error) {
 	data, err := json.Marshal(pact)
 	if err != nil {
@@ -360,7 +354,7 @@ func CreatePact(pactLogger *log.Logger, ctx context.Context,
 	return nil, nil
 }
 
-func CreatePactVersion(pactLogger *log.Logger, ctx context.Context, pactVersionKey string, pactVersion brokerpb.PactVersion) (*brokerpb.PublishPactResponse, error) {
+func CreatePactVersion(ctx context.Context, pactVersionKey string, pactVersion brokerpb.PactVersion) (*brokerpb.PublishPactResponse, error) {
 	data, err := json.Marshal(pactVersion)
 	if err != nil {
 		PactLogger.Errorf(nil, "pact publish failed, pact version cannot be created.")
@@ -391,7 +385,7 @@ func CreatePactVersion(pactLogger *log.Logger, ctx context.Context, pactVersionK
 	return nil, nil
 }
 
-func CreateVerification(pactLogger *log.Logger, ctx context.Context,
+func CreateVerification(ctx context.Context,
 	verificationKey string, verification brokerpb.Verification) (*brokerpb.PublishVerificationResponse, error) {
 	data, err := json.Marshal(verification)
 	if err != nil {
@@ -425,7 +419,7 @@ func CreateVerification(pactLogger *log.Logger, ctx context.Context,
 }
 
 func GetLastestVersionNumberForParticipant(ctx context.Context,
-	tenant string, participantId int32) int32 {
+	tenant string, participantID int32) int32 {
 	key := util.StringJoin([]string{
 		GetBrokerVersionKey(tenant), ""}, "/")
 	versions, err := Store().Version().Search(ctx,
@@ -442,7 +436,7 @@ func GetLastestVersionNumberForParticipant(ctx context.Context,
 		if err != nil {
 			return -1
 		}
-		if version.ParticipantId != participantId {
+		if version.ParticipantId != participantID {
 			continue
 		}
 		if version.Order > order {
@@ -508,7 +502,7 @@ func RetrieveProviderConsumerPact(ctx context.Context,
 		}, -1, err
 	}
 	// Get or create version
-	//versionKey := apt.GenerateBrokerVersionKey(tenant, in.Version, consumerParticipant.Id)
+	//versionKey := apt.GenerateBrokerVersionKey(tenant, in.Version, consumerParticipant.ID)
 	version, err := GetVersion(ctx, tenant, in.Version, consumerParticipant.Id)
 	if err != nil || version == nil {
 		PactLogger.Errorf(nil, "pact retrieve failed, version cannot be searched.")
@@ -532,7 +526,7 @@ func RetrieveProviderConsumerPact(ctx context.Context,
 		PactLogger.Info("[RetrieveProviderPact] No pact version found, sorry")
 		return nil, -1, nil
 	}
-	pactIds := make(map[int32]int32)
+	pactIDs := make(map[int32]int32)
 	for i := 0; i < len(pactVersions.Kvs); i++ {
 		pactVersion := &brokerpb.PactVersion{}
 		err = json.Unmarshal(pactVersions.Kvs[i].Value.([]byte), pactVersion)
@@ -542,10 +536,10 @@ func RetrieveProviderConsumerPact(ctx context.Context,
 		// Obviously true, but checking it anyways
 		if pactVersion.VersionId == version.Id {
 			pactid := pactVersion.PactId
-			pactIds[pactid] = pactid
+			pactIDs[pactid] = pactid
 		}
 	}
-	if len(pactIds) == 0 {
+	if len(pactIDs) == 0 {
 		PactLogger.Errorf(nil, "pact retrieve failed, pact cannot be found.")
 		return &brokerpb.GetProviderConsumerVersionPactResponse{
 			Response: pb.CreateResponse(scerr.ErrInternal, "pact cannot be found."),
@@ -573,7 +567,7 @@ func RetrieveProviderConsumerPact(ctx context.Context,
 		if err != nil {
 			return nil, -1, err
 		}
-		if _, ok := pactIds[pactObj.Id]; ok {
+		if _, ok := pactIDs[pactObj.Id]; ok {
 			//PactLogger.Infof("pact retrieve succeeded, found pact: %s", string(pactObj.Content))
 			return &brokerpb.GetProviderConsumerVersionPactResponse{
 				Response: pb.CreateResponse(pb.Response_SUCCESS, "pact found."),
diff --git a/server/core/backend/addon.go b/server/core/backend/addon.go
index 5cff89e..a372b97 100644
--- a/server/core/backend/addon.go
+++ b/server/core/backend/addon.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package backend
 
 import (
diff --git a/server/core/backend/common.go b/server/core/backend/common.go
index 24373cf..15a1bb2 100644
--- a/server/core/backend/common.go
+++ b/server/core/backend/common.go
@@ -32,20 +32,20 @@ const (
 )
 
 var (
-	DOMAIN           discovery.Type
-	PROJECT          discovery.Type
-	SERVICE          discovery.Type
-	SERVICE_INDEX    discovery.Type
-	SERVICE_ALIAS    discovery.Type
-	SERVICE_TAG      discovery.Type
-	RULE             discovery.Type
-	RULE_INDEX       discovery.Type
-	DEPENDENCY_RULE  discovery.Type
-	DEPENDENCY_QUEUE discovery.Type
-	SCHEMA           discovery.Type
-	SCHEMA_SUMMARY   discovery.Type
-	INSTANCE         discovery.Type
-	LEASE            discovery.Type
+	DOMAIN          discovery.Type
+	PROJECT         discovery.Type
+	SERVICE         discovery.Type
+	ServiceIndex    discovery.Type
+	ServiceAlias    discovery.Type
+	ServiceTag      discovery.Type
+	RULE            discovery.Type
+	RuleIndex       discovery.Type
+	DependencyRule  discovery.Type
+	DependencyQueue discovery.Type
+	SCHEMA          discovery.Type
+	SchemaSummary   discovery.Type
+	INSTANCE        discovery.Type
+	LEASE           discovery.Type
 )
 
 func registerInnerTypes() {
@@ -62,7 +62,7 @@ func registerInnerTypes() {
 	SCHEMA = Store().MustInstall(NewAddOn("SCHEMA",
 		discovery.Configure().WithPrefix(core.GetServiceSchemaRootKey("")).
 			WithInitSize(0)))
-	SCHEMA_SUMMARY = Store().MustInstall(NewAddOn("SCHEMA_SUMMARY",
+	SchemaSummary = Store().MustInstall(NewAddOn("SCHEMA_SUMMARY",
 		discovery.Configure().WithPrefix(core.GetServiceSchemaSummaryRootKey("")).
 			WithInitSize(100).WithParser(pb.StringParser)))
 	RULE = Store().MustInstall(NewAddOn("RULE",
@@ -71,22 +71,22 @@ func registerInnerTypes() {
 	LEASE = Store().MustInstall(NewAddOn("LEASE",
 		discovery.Configure().WithPrefix(core.GetInstanceLeaseRootKey("")).
 			WithInitSize(1000).WithParser(pb.StringParser)))
-	SERVICE_INDEX = Store().MustInstall(NewAddOn("SERVICE_INDEX",
+	ServiceIndex = Store().MustInstall(NewAddOn("SERVICE_INDEX",
 		discovery.Configure().WithPrefix(core.GetServiceIndexRootKey("")).
 			WithInitSize(500).WithParser(pb.StringParser)))
-	SERVICE_ALIAS = Store().MustInstall(NewAddOn("SERVICE_ALIAS",
+	ServiceAlias = Store().MustInstall(NewAddOn("SERVICE_ALIAS",
 		discovery.Configure().WithPrefix(core.GetServiceAliasRootKey("")).
 			WithInitSize(100).WithParser(pb.StringParser)))
-	SERVICE_TAG = Store().MustInstall(NewAddOn("SERVICE_TAG",
+	ServiceTag = Store().MustInstall(NewAddOn("SERVICE_TAG",
 		discovery.Configure().WithPrefix(core.GetServiceTagRootKey("")).
 			WithInitSize(100).WithParser(pb.MapParser)))
-	RULE_INDEX = Store().MustInstall(NewAddOn("RULE_INDEX",
+	RuleIndex = Store().MustInstall(NewAddOn("RULE_INDEX",
 		discovery.Configure().WithPrefix(core.GetServiceRuleIndexRootKey("")).
 			WithInitSize(100).WithParser(pb.StringParser)))
-	DEPENDENCY_RULE = Store().MustInstall(NewAddOn("DEPENDENCY_RULE",
+	DependencyRule = Store().MustInstall(NewAddOn("DEPENDENCY_RULE",
 		discovery.Configure().WithPrefix(core.GetServiceDependencyRuleRootKey("")).
 			WithInitSize(100).WithParser(pb.DependencyRuleParser)))
-	DEPENDENCY_QUEUE = Store().MustInstall(NewAddOn("DEPENDENCY_QUEUE",
+	DependencyQueue = Store().MustInstall(NewAddOn("DEPENDENCY_QUEUE",
 		discovery.Configure().WithPrefix(core.GetServiceDependencyQueueRootKey("")).
 			WithInitSize(100).WithParser(pb.DependencyQueueParser)))
 	PROJECT = Store().MustInstall(NewAddOn("PROJECT",
diff --git a/server/core/backend/defer_instance.go b/server/core/backend/defer_instance.go
index 284b684..9149f42 100644
--- a/server/core/backend/defer_instance.go
+++ b/server/core/backend/defer_instance.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package backend
 
 import (
diff --git a/server/core/backend/discovery.go b/server/core/backend/discovery.go
index 34ec692..304847c 100644
--- a/server/core/backend/discovery.go
+++ b/server/core/backend/discovery.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package backend
 
 import (
@@ -27,7 +28,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin"
 	"github.com/apache/servicecomb-service-center/server/plugin/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/registry"
-	"sync"
 	"time"
 )
 
@@ -41,8 +41,7 @@ func init() {
 type KvStore struct {
 	AddOns      map[discovery.Type]AddOn
 	adaptors    util.ConcurrentMap
-	taskService task.TaskService
-	lock        sync.RWMutex
+	taskService task.Service
 	ready       chan struct{}
 	goroutine   *gopool.Pool
 	isClose     bool
@@ -50,7 +49,7 @@ type KvStore struct {
 }
 
 func (s *KvStore) Initialize() {
-	s.AddOns = make(map[discovery.Type]AddOn, 0)
+	s.AddOns = make(map[discovery.Type]AddOn)
 	s.taskService = task.NewTaskService()
 	s.ready = make(chan struct{})
 	s.goroutine = gopool.New(context.Background())
@@ -129,10 +128,6 @@ func (s *KvStore) autoClearCache(ctx context.Context) {
 	}
 }
 
-func (s *KvStore) closed() bool {
-	return s.isClose
-}
-
 func (s *KvStore) Stop() {
 	if s.isClose {
 		return
@@ -188,17 +183,17 @@ func (s *KvStore) MustInstall(addOn AddOn) discovery.Type {
 
 func (s *KvStore) Adaptors(id discovery.Type) discovery.Adaptor { return s.getOrCreateAdaptor(id) }
 func (s *KvStore) Service() discovery.Adaptor                   { return s.Adaptors(SERVICE) }
-func (s *KvStore) SchemaSummary() discovery.Adaptor             { return s.Adaptors(SCHEMA_SUMMARY) }
+func (s *KvStore) SchemaSummary() discovery.Adaptor             { return s.Adaptors(SchemaSummary) }
 func (s *KvStore) Instance() discovery.Adaptor                  { return s.Adaptors(INSTANCE) }
 func (s *KvStore) Lease() discovery.Adaptor                     { return s.Adaptors(LEASE) }
-func (s *KvStore) ServiceIndex() discovery.Adaptor              { return s.Adaptors(SERVICE_INDEX) }
-func (s *KvStore) ServiceAlias() discovery.Adaptor              { return s.Adaptors(SERVICE_ALIAS) }
-func (s *KvStore) ServiceTag() discovery.Adaptor                { return s.Adaptors(SERVICE_TAG) }
+func (s *KvStore) ServiceIndex() discovery.Adaptor              { return s.Adaptors(ServiceIndex) }
+func (s *KvStore) ServiceAlias() discovery.Adaptor              { return s.Adaptors(ServiceAlias) }
+func (s *KvStore) ServiceTag() discovery.Adaptor                { return s.Adaptors(ServiceTag) }
 func (s *KvStore) Rule() discovery.Adaptor                      { return s.Adaptors(RULE) }
-func (s *KvStore) RuleIndex() discovery.Adaptor                 { return s.Adaptors(RULE_INDEX) }
+func (s *KvStore) RuleIndex() discovery.Adaptor                 { return s.Adaptors(RuleIndex) }
 func (s *KvStore) Schema() discovery.Adaptor                    { return s.Adaptors(SCHEMA) }
-func (s *KvStore) DependencyRule() discovery.Adaptor            { return s.Adaptors(DEPENDENCY_RULE) }
-func (s *KvStore) DependencyQueue() discovery.Adaptor           { return s.Adaptors(DEPENDENCY_QUEUE) }
+func (s *KvStore) DependencyRule() discovery.Adaptor            { return s.Adaptors(DependencyRule) }
+func (s *KvStore) DependencyQueue() discovery.Adaptor           { return s.Adaptors(DependencyQueue) }
 func (s *KvStore) Domain() discovery.Adaptor                    { return s.Adaptors(DOMAIN) }
 func (s *KvStore) Project() discovery.Adaptor                   { return s.Adaptors(PROJECT) }
 
@@ -208,7 +203,7 @@ func (s *KvStore) KeepAlive(ctx context.Context, opts ...registry.PluginOpOption
 	op := registry.OpPut(opts...)
 
 	t := NewLeaseAsyncTask(op)
-	if op.Mode == registry.MODE_NO_CACHE {
+	if op.Mode == registry.ModeNoCache {
 		log.Debugf("keep alive lease WitchNoCache, request etcd server, op: %s", op)
 		err := t.Do(ctx)
 		ttl := t.TTL
diff --git a/server/core/backend/lease.go b/server/core/backend/lease.go
index 4ad045f..39b3691 100644
--- a/server/core/backend/lease.go
+++ b/server/core/backend/lease.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package backend
 
 import (
@@ -47,7 +48,7 @@ func (lat *LeaseTask) Do(ctx context.Context) (err error) {
 	ReportHeartbeatCompleted(err, recv)
 	if err != nil {
 		log.Errorf(err, "[%s]task[%s] renew lease[%d] failed(recv: %s, send: %s)",
-			time.Now().Sub(recv),
+			time.Since(recv),
 			lat.Key(),
 			lat.LeaseID,
 			recv.Format(leaseProfTimeFmt),
@@ -61,7 +62,7 @@ func (lat *LeaseTask) Do(ctx context.Context) (err error) {
 
 	lat.err, err = nil, nil
 
-	cost := time.Now().Sub(recv)
+	cost := time.Since(recv)
 	if cost >= 2*time.Second {
 		log.Warnf("[%s]task[%s] renew lease[%d](recv: %s, send: %s)",
 			cost,
diff --git a/server/core/backend/lease_test.go b/server/core/backend/lease_test.go
index db8c28d..4765c51 100644
--- a/server/core/backend/lease_test.go
+++ b/server/core/backend/lease_test.go
@@ -27,7 +27,7 @@ import (
 )
 
 type mockRegistry struct {
-	*buildin.BuildinRegistry
+	*buildin.Registry
 	LeaseErr error
 }
 
diff --git a/server/core/backend/metrics.go b/server/core/backend/metrics.go
index 8150766..e9f8e0b 100644
--- a/server/core/backend/metrics.go
+++ b/server/core/backend/metrics.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package backend
 
 import (
@@ -50,7 +51,7 @@ var (
 			Subsystem:  "db",
 			Name:       "heartbeat_durations_microseconds",
 			Help:       "Latency of heartbeat renew",
-			Objectives: prometheus.DefObjectives,
+			Objectives: metric.Pxx,
 		}, []string{"instance", "status"})
 )
 
diff --git a/server/core/backend/registry.go b/server/core/backend/registry.go
index f906866..f4e98d0 100644
--- a/server/core/backend/registry.go
+++ b/server/core/backend/registry.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package backend
 
 import (
@@ -32,16 +33,16 @@ import (
 )
 
 var (
-	engineInstance *registryEngine
+	engineInstance *RegistryEngine
 	singletonLock  sync.Mutex
 )
 
 const (
 	// the same as v3rpc.MaxOpsPerTxn = 128
-	MAX_TXN_NUMBER_ONE_TIME = 128
+	MaxTxnNumberOneTime = 128
 )
 
-func NewEngine() (*registryEngine, error) {
+func NewEngine() (*RegistryEngine, error) {
 	instance := plugin.Plugins().Registry()
 	if instance == nil {
 		return nil, errors.New("register center client plugin does not exist")
@@ -52,17 +53,17 @@ func NewEngine() (*registryEngine, error) {
 		return nil, err
 	case <-instance.Ready():
 	}
-	return &registryEngine{
+	return &RegistryEngine{
 		Registry:  instance,
 		goroutine: gopool.New(context.Background()),
 	}, nil
 }
 
 func Registry() registry.Registry {
-	return RegistryEngine()
+	return GetRegistryEngine()
 }
 
-func RegistryEngine() *registryEngine {
+func GetRegistryEngine() *RegistryEngine {
 	if engineInstance == nil {
 		singletonLock.Lock()
 		for i := 0; engineInstance == nil; i++ {
@@ -95,13 +96,13 @@ func BatchCommitWithCmp(ctx context.Context, opts []registry.PluginOp,
 	cmp []registry.CompareOp, fail []registry.PluginOp) (resp *registry.PluginResponse, err error) {
 	lenOpts := len(opts)
 	tmpLen := lenOpts
-	tmpOpts := []registry.PluginOp{}
+	var tmpOpts []registry.PluginOp
 	for i := 0; tmpLen > 0; i++ {
-		tmpLen = lenOpts - (i+1)*MAX_TXN_NUMBER_ONE_TIME
+		tmpLen = lenOpts - (i+1)*MaxTxnNumberOneTime
 		if tmpLen > 0 {
-			tmpOpts = opts[i*MAX_TXN_NUMBER_ONE_TIME : (i+1)*MAX_TXN_NUMBER_ONE_TIME]
+			tmpOpts = opts[i*MaxTxnNumberOneTime : (i+1)*MaxTxnNumberOneTime]
 		} else {
-			tmpOpts = opts[i*MAX_TXN_NUMBER_ONE_TIME : lenOpts]
+			tmpOpts = opts[i*MaxTxnNumberOneTime : lenOpts]
 		}
 		resp, err = Registry().TxnWithCmp(ctx, tmpOpts, cmp, fail)
 		if err != nil || !resp.Succeeded {
@@ -111,12 +112,12 @@ func BatchCommitWithCmp(ctx context.Context, opts []registry.PluginOp,
 	return
 }
 
-type registryEngine struct {
+type RegistryEngine struct {
 	registry.Registry
 	goroutine *gopool.Pool
 }
 
-func (s *registryEngine) Start() error {
+func (s *RegistryEngine) Start() error {
 	err := s.selfRegister(context.Background())
 	if err != nil {
 		return err
@@ -127,16 +128,17 @@ func (s *registryEngine) Start() error {
 	return nil
 }
 
-func (s *registryEngine) Stop() {
+func (s *RegistryEngine) Stop() {
 	s.goroutine.Close(true)
 
-	ctx, _ := context.WithTimeout(context.Background(), 3*time.Second)
+	ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
+	defer cancel()
 	if err := s.unregisterInstance(ctx); err != nil {
 		log.Error("stop registry engine failed", err)
 	}
 }
 
-func (s *registryEngine) selfRegister(ctx context.Context) error {
+func (s *RegistryEngine) selfRegister(ctx context.Context) error {
 	err := s.registryService(context.Background())
 	if err != nil {
 		return err
@@ -145,7 +147,7 @@ func (s *registryEngine) selfRegister(ctx context.Context) error {
 	return s.registryInstance(context.Background())
 }
 
-func (s *registryEngine) registryService(pCtx context.Context) error {
+func (s *RegistryEngine) registryService(pCtx context.Context) error {
 	ctx := core.AddDefaultContextValue(pCtx)
 	respE, err := core.ServiceAPI.Exist(ctx, core.GetExistenceRequest())
 	if err != nil {
@@ -157,7 +159,7 @@ func (s *registryEngine) registryService(pCtx context.Context) error {
 		respG, err := core.ServiceAPI.GetOne(ctx, core.GetServiceRequest(respE.ServiceId))
 		if respG.Response.Code != pb.Response_SUCCESS {
 			log.Errorf(err, "query service center service[%s] info failed", respE.ServiceId)
-			return fmt.Errorf("service center service file lost.")
+			return fmt.Errorf("service center service file lost")
 		}
 		core.Service = respG.Service
 		return nil
@@ -173,13 +175,17 @@ func (s *registryEngine) registryService(pCtx context.Context) error {
 	return nil
 }
 
-func (s *registryEngine) registryInstance(pCtx context.Context) error {
+func (s *RegistryEngine) registryInstance(pCtx context.Context) error {
 	core.Instance.InstanceId = ""
 	core.Instance.ServiceId = core.Service.ServiceId
 
 	ctx := core.AddDefaultContextValue(pCtx)
 
 	respI, err := core.InstanceAPI.Register(ctx, core.RegisterInstanceRequest())
+	if err != nil {
+		log.Error("register failed", err)
+		return err
+	}
 	if respI.Response.Code != pb.Response_SUCCESS {
 		err = fmt.Errorf("register service center[%s] instance failed, %s",
 			core.Instance.ServiceId, respI.Response.Message)
@@ -192,12 +198,16 @@ func (s *registryEngine) registryInstance(pCtx context.Context) error {
 	return nil
 }
 
-func (s *registryEngine) unregisterInstance(pCtx context.Context) error {
+func (s *RegistryEngine) unregisterInstance(pCtx context.Context) error {
 	if len(core.Instance.InstanceId) == 0 {
 		return nil
 	}
 	ctx := core.AddDefaultContextValue(pCtx)
 	respI, err := core.InstanceAPI.Unregister(ctx, core.UnregisterInstanceRequest())
+	if err != nil {
+		log.Error("unregister failed", err)
+		return err
+	}
 	if respI.Response.Code != pb.Response_SUCCESS {
 		err = fmt.Errorf("unregister service center instance[%s/%s] failed, %s",
 			core.Instance.ServiceId, core.Instance.InstanceId, respI.Response.Message)
@@ -209,9 +219,13 @@ func (s *registryEngine) unregisterInstance(pCtx context.Context) error {
 	return nil
 }
 
-func (s *registryEngine) sendHeartBeat(pCtx context.Context) {
+func (s *RegistryEngine) sendHeartBeat(pCtx context.Context) {
 	ctx := core.AddDefaultContextValue(pCtx)
 	respI, err := core.InstanceAPI.Heartbeat(ctx, core.HeartbeatRequest())
+	if err != nil {
+		log.Error("sen heartbeat failed", err)
+		return
+	}
 	if respI.Response.Code == pb.Response_SUCCESS {
 		log.Debugf("update service center instance[%s/%s] heartbeat",
 			core.Instance.ServiceId, core.Instance.InstanceId)
@@ -228,7 +242,7 @@ func (s *registryEngine) sendHeartBeat(pCtx context.Context) {
 	}
 }
 
-func (s *registryEngine) heartBeatService() {
+func (s *RegistryEngine) heartBeatService() {
 	s.goroutine.Do(func(ctx context.Context) {
 		for {
 			select {
diff --git a/server/core/config.go b/server/core/config.go
index da32d0f..2cb98f1 100644
--- a/server/core/config.go
+++ b/server/core/config.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package core
 
 import (
diff --git a/server/core/core.go b/server/core/core.go
index af80613..69d00ff 100644
--- a/server/core/core.go
+++ b/server/core/core.go
@@ -53,10 +53,9 @@ func ParseCommandLine() {
 func handleSignals() {
 	defer log.Sync()
 
-	sigCh := make(chan os.Signal)
+	sigCh := make(chan os.Signal, 1)
 	signal.Notify(sigCh,
 		syscall.SIGINT,
-		syscall.SIGKILL,
 		syscall.SIGTERM,
 	)
 	wait := 5 * time.Second
diff --git a/server/core/key_convertor.go b/server/core/key_convertor.go
index 92176a1..d504c89 100644
--- a/server/core/key_convertor.go
+++ b/server/core/key_convertor.go
@@ -26,25 +26,25 @@ func KvToResponse(key []byte) (keys []string) {
 	return strings.Split(util.BytesToStringWithNoCopy(key), SPLIT)
 }
 
-func GetInfoFromSvcKV(key []byte) (serviceId, domainProject string) {
+func GetInfoFromSvcKV(key []byte) (serviceID, domainProject string) {
 	keys := KvToResponse(key)
 	l := len(keys)
 	if l < 4 {
 		return
 	}
-	serviceId = keys[l-1]
+	serviceID = keys[l-1]
 	domainProject = fmt.Sprintf("%s/%s", keys[l-3], keys[l-2])
 	return
 }
 
-func GetInfoFromInstKV(key []byte) (serviceId, instanceId, domainProject string) {
+func GetInfoFromInstKV(key []byte) (serviceID, instanceID, domainProject string) {
 	keys := KvToResponse(key)
 	l := len(keys)
 	if l < 4 {
 		return
 	}
-	serviceId = keys[l-2]
-	instanceId = keys[l-1]
+	serviceID = keys[l-2]
+	instanceID = keys[l-1]
 	domainProject = fmt.Sprintf("%s/%s", keys[l-4], keys[l-3])
 	return
 }
@@ -69,25 +69,25 @@ func GetInfoFromProjectKV(key []byte) (domainProject string) {
 	return
 }
 
-func GetInfoFromRuleKV(key []byte) (serviceId, ruleId, domainProject string) {
+func GetInfoFromRuleKV(key []byte) (serviceID, ruleID, domainProject string) {
 	keys := KvToResponse(key)
 	l := len(keys)
 	if l < 4 {
 		return
 	}
-	serviceId = keys[l-2]
-	ruleId = keys[l-1]
+	serviceID = keys[l-2]
+	ruleID = keys[l-1]
 	domainProject = fmt.Sprintf("%s/%s", keys[l-4], keys[l-3])
 	return
 }
 
-func GetInfoFromTagKV(key []byte) (serviceId, domainProject string) {
+func GetInfoFromTagKV(key []byte) (serviceID, domainProject string) {
 	keys := KvToResponse(key)
 	l := len(keys)
 	if l < 3 {
 		return
 	}
-	serviceId = keys[l-1]
+	serviceID = keys[l-1]
 	domainProject = fmt.Sprintf("%s/%s", keys[l-3], keys[l-2])
 	return
 }
@@ -112,7 +112,7 @@ func GetInfoFromSvcAliasKV(key []byte) *pb.MicroServiceKey {
 	return GetInfoFromSvcIndexKV(key)
 }
 
-func GetInfoFromSchemaSummaryKV(key []byte) (domainProject, serviceId, schemaId string) {
+func GetInfoFromSchemaSummaryKV(key []byte) (domainProject, serviceID, schemaID string) {
 	keys := KvToResponse(key)
 	l := len(keys)
 	if l < 4 {
@@ -122,7 +122,7 @@ func GetInfoFromSchemaSummaryKV(key []byte) (domainProject, serviceId, schemaId
 	return domainProject, keys[l-2], keys[l-1]
 }
 
-func GetInfoFromSchemaKV(key []byte) (domainProject, serviceId, schemaId string) {
+func GetInfoFromSchemaKV(key []byte) (domainProject, serviceID, schemaID string) {
 	keys := KvToResponse(key)
 	l := len(keys)
 	if l < 4 {
@@ -132,13 +132,13 @@ func GetInfoFromSchemaKV(key []byte) (domainProject, serviceId, schemaId string)
 	return domainProject, keys[l-2], keys[l-1]
 }
 
-func GetInfoFromDependencyQueueKV(key []byte) (consumerId, domainProject, uuid string) {
+func GetInfoFromDependencyQueueKV(key []byte) (consumerID, domainProject, uuid string) {
 	keys := KvToResponse(key)
 	l := len(keys)
 	if l < 4 {
 		return
 	}
-	consumerId = keys[l-2]
+	consumerID = keys[l-2]
 	domainProject = fmt.Sprintf("%s/%s", keys[l-4], keys[l-3])
 	uuid = keys[l-1]
 	return
diff --git a/server/core/key_convertor_test.go b/server/core/key_convertor_test.go
index 0f1a07e..244bd3f 100644
--- a/server/core/key_convertor_test.go
+++ b/server/core/key_convertor_test.go
@@ -134,7 +134,7 @@ func TestGetInfoFromKV(t *testing.T) {
 		AppId:       "c",
 		ServiceName: "*",
 	})))
-	if dt != DEPS_PROVIDER || k == nil || k.AppId != "" || k.ServiceName != "*" {
+	if dt != DepsProvider || k == nil || k.AppId != "" || k.ServiceName != "*" {
 		t.Fatalf("TestGetInfoFromKV failed")
 	}
 
@@ -144,7 +144,7 @@ func TestGetInfoFromKV(t *testing.T) {
 		ServiceName: "d",
 		Version:     "e",
 	})))
-	if dt != DEPS_PROVIDER || k == nil || k.AppId != "c" || k.ServiceName != "d" {
+	if dt != DepsProvider || k == nil || k.AppId != "c" || k.ServiceName != "d" {
 		t.Fatalf("TestGetInfoFromKV failed")
 	}
 
diff --git a/server/core/key_generator.go b/server/core/key_generator.go
index e86ad98..00e0372 100644
--- a/server/core/key_generator.go
+++ b/server/core/key_generator.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package core
 
 import (
@@ -22,40 +23,40 @@ import (
 )
 
 const (
-	SPLIT                       = "/"
-	REGISTRY_ROOT_KEY           = "cse-sr"
-	REGISTRY_SYS_KEY            = "sys"
-	REGISTRY_SERVICE_KEY        = "ms"
-	REGISTRY_INSTANCE_KEY       = "inst"
-	REGISTRY_FILE               = "files"
-	REGISTRY_INDEX              = "indexes"
-	REGISTRY_RULE_KEY           = "rules"
-	REGISTRY_RULE_INDEX_KEY     = "rule-indexes"
-	REGISTRY_DOMAIN_KEY         = "domains"
-	REGISTRY_PROJECT_KEY        = "projects"
-	REGISTRY_ALIAS_KEY          = "alias"
-	REGISTRY_TAG_KEY            = "tags"
-	REGISTRY_SCHEMA_KEY         = "schemas"
-	REGISTRY_SCHEMA_SUMMARY_KEY = "schema-sum"
-	REGISTRY_LEASE_KEY          = "leases"
-	REGISTRY_DEPENDENCY_KEY     = "deps"
-	REGISTRY_DEPS_RULE_KEY      = "dep-rules"
-	REGISTRY_DEPS_QUEUE_KEY     = "dep-queue"
-	REGISTRY_METRICS_KEY        = "metrics"
-	DEPS_QUEUE_UUID             = "0"
-	DEPS_CONSUMER               = "c"
-	DEPS_PROVIDER               = "p"
+	SPLIT                    = "/"
+	RegistryRootKey          = "cse-sr"
+	RegistrySysKey           = "sys"
+	RegistryServiceKey       = "ms"
+	RegistryInstanceKey      = "inst"
+	RegistryFile             = "files"
+	RegistryIndex            = "indexes"
+	RegistryRuleKey          = "rules"
+	RegistryRuleIndexKey     = "rule-indexes"
+	RegistryDomainKey        = "domains"
+	RegistryProjectKey       = "projects"
+	RegistryAliasKey         = "alias"
+	RegistryTagKey           = "tags"
+	RegistrySchemaKey        = "schemas"
+	RegistrySchemaSummaryKey = "schema-sum"
+	RegistryLeaseKey         = "leases"
+	RegistryDependencyKey    = "deps"
+	RegistryDepsRuleKey      = "dep-rules"
+	RegistryDepsQueueKey     = "dep-queue"
+	RegistryMetricsKey       = "metrics"
+	DepsQueueUUID            = "0"
+	DepsConsumer             = "c"
+	DepsProvider             = "p"
 )
 
 func GetRootKey() string {
-	return SPLIT + REGISTRY_ROOT_KEY
+	return SPLIT + RegistryRootKey
 }
 
 func GetServiceRootKey(domainProject string) string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_SERVICE_KEY,
-		REGISTRY_FILE,
+		RegistryServiceKey,
+		RegistryFile,
 		domainProject,
 	}, SPLIT)
 }
@@ -63,8 +64,8 @@ func GetServiceRootKey(domainProject string) string {
 func GetServiceIndexRootKey(domainProject string) string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_SERVICE_KEY,
-		REGISTRY_INDEX,
+		RegistryServiceKey,
+		RegistryIndex,
 		domainProject,
 	}, SPLIT)
 }
@@ -72,25 +73,25 @@ func GetServiceIndexRootKey(domainProject string) string {
 func GetServiceAliasRootKey(domainProject string) string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_SERVICE_KEY,
-		REGISTRY_ALIAS_KEY,
+		RegistryServiceKey,
+		RegistryAliasKey,
 		domainProject,
 	}, SPLIT)
 }
 
-func GetServiceAppKey(domainProject, env, appId string) string {
+func GetServiceAppKey(domainProject, env, appID string) string {
 	return util.StringJoin([]string{
 		GetServiceIndexRootKey(domainProject),
 		env,
-		appId,
+		appID,
 	}, SPLIT)
 }
 
 func GetServiceRuleRootKey(domainProject string) string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_SERVICE_KEY,
-		REGISTRY_RULE_KEY,
+		RegistryServiceKey,
+		RegistryRuleKey,
 		domainProject,
 	}, SPLIT)
 }
@@ -98,8 +99,8 @@ func GetServiceRuleRootKey(domainProject string) string {
 func GetServiceRuleIndexRootKey(domainProject string) string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_SERVICE_KEY,
-		REGISTRY_RULE_INDEX_KEY,
+		RegistryServiceKey,
+		RegistryRuleIndexKey,
 		domainProject,
 	}, SPLIT)
 }
@@ -107,8 +108,8 @@ func GetServiceRuleIndexRootKey(domainProject string) string {
 func GetServiceTagRootKey(domainProject string) string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_SERVICE_KEY,
-		REGISTRY_TAG_KEY,
+		RegistryServiceKey,
+		RegistryTagKey,
 		domainProject,
 	}, SPLIT)
 }
@@ -116,8 +117,8 @@ func GetServiceTagRootKey(domainProject string) string {
 func GetServiceSchemaRootKey(domainProject string) string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_SERVICE_KEY,
-		REGISTRY_SCHEMA_KEY,
+		RegistryServiceKey,
+		RegistrySchemaKey,
 		domainProject,
 	}, SPLIT)
 }
@@ -125,8 +126,8 @@ func GetServiceSchemaRootKey(domainProject string) string {
 func GetInstanceRootKey(domainProject string) string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_INSTANCE_KEY,
-		REGISTRY_FILE,
+		RegistryInstanceKey,
+		RegistryFile,
 		domainProject,
 	}, SPLIT)
 }
@@ -134,23 +135,23 @@ func GetInstanceRootKey(domainProject string) string {
 func GetInstanceLeaseRootKey(domainProject string) string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_INSTANCE_KEY,
-		REGISTRY_LEASE_KEY,
+		RegistryInstanceKey,
+		RegistryLeaseKey,
 		domainProject,
 	}, SPLIT)
 }
 
-func GenerateServiceKey(domainProject string, serviceId string) string {
+func GenerateServiceKey(domainProject string, serviceID string) string {
 	return util.StringJoin([]string{
 		GetServiceRootKey(domainProject),
-		serviceId,
+		serviceID,
 	}, SPLIT)
 }
 
-func GenerateRuleIndexKey(domainProject string, serviceId string, attr string, pattern string) string {
+func GenerateRuleIndexKey(domainProject string, serviceID string, attr string, pattern string) string {
 	return util.StringJoin([]string{
 		GetServiceRuleIndexRootKey(domainProject),
-		serviceId,
+		serviceID,
 		attr,
 		pattern,
 	}, SPLIT)
@@ -176,59 +177,59 @@ func GenerateServiceAliasKey(key *pb.MicroServiceKey) string {
 	}, SPLIT)
 }
 
-func GenerateServiceRuleKey(domainProject string, serviceId string, ruleId string) string {
+func GenerateServiceRuleKey(domainProject string, serviceID string, ruleID string) string {
 	return util.StringJoin([]string{
 		GetServiceRuleRootKey(domainProject),
-		serviceId,
-		ruleId,
+		serviceID,
+		ruleID,
 	}, SPLIT)
 }
 
-func GenerateServiceTagKey(domainProject string, serviceId string) string {
+func GenerateServiceTagKey(domainProject string, serviceID string) string {
 	return util.StringJoin([]string{
 		GetServiceTagRootKey(domainProject),
-		serviceId,
+		serviceID,
 	}, SPLIT)
 }
 
-func GenerateServiceSchemaKey(domainProject string, serviceId string, schemaId string) string {
+func GenerateServiceSchemaKey(domainProject string, serviceID string, schemaID string) string {
 	return util.StringJoin([]string{
 		GetServiceSchemaRootKey(domainProject),
-		serviceId,
-		schemaId,
+		serviceID,
+		schemaID,
 	}, SPLIT)
 }
 
-func GenerateServiceSchemaSummaryKey(domainProject string, serviceId string, schemaId string) string {
+func GenerateServiceSchemaSummaryKey(domainProject string, serviceID string, schemaID string) string {
 	return util.StringJoin([]string{
 		GetServiceSchemaSummaryRootKey(domainProject),
-		serviceId,
-		schemaId,
+		serviceID,
+		schemaID,
 	}, SPLIT)
 }
 
 func GetServiceSchemaSummaryRootKey(domainProject string) string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_SERVICE_KEY,
-		REGISTRY_SCHEMA_SUMMARY_KEY,
+		RegistryServiceKey,
+		RegistrySchemaSummaryKey,
 		domainProject,
 	}, SPLIT)
 }
 
-func GenerateInstanceKey(domainProject string, serviceId string, instanceId string) string {
+func GenerateInstanceKey(domainProject string, serviceID string, instanceID string) string {
 	return util.StringJoin([]string{
 		GetInstanceRootKey(domainProject),
-		serviceId,
-		instanceId,
+		serviceID,
+		instanceID,
 	}, SPLIT)
 }
 
-func GenerateInstanceLeaseKey(domainProject string, serviceId string, instanceId string) string {
+func GenerateInstanceLeaseKey(domainProject string, serviceID string, instanceID string) string {
 	return util.StringJoin([]string{
 		GetInstanceLeaseRootKey(domainProject),
-		serviceId,
-		instanceId,
+		serviceID,
+		instanceID,
 	}, SPLIT)
 }
 
@@ -258,18 +259,18 @@ func GenerateServiceDependencyRuleKey(serviceType string, domainProject string,
 }
 
 func GenerateConsumerDependencyRuleKey(domainProject string, in *pb.MicroServiceKey) string {
-	return GenerateServiceDependencyRuleKey(DEPS_CONSUMER, domainProject, in)
+	return GenerateServiceDependencyRuleKey(DepsConsumer, domainProject, in)
 }
 
 func GenerateProviderDependencyRuleKey(domainProject string, in *pb.MicroServiceKey) string {
-	return GenerateServiceDependencyRuleKey(DEPS_PROVIDER, domainProject, in)
+	return GenerateServiceDependencyRuleKey(DepsProvider, domainProject, in)
 }
 
 func GetServiceDependencyRuleRootKey(domainProject string) string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_SERVICE_KEY,
-		REGISTRY_DEPS_RULE_KEY,
+		RegistryServiceKey,
+		RegistryDepsRuleKey,
 		domainProject,
 	}, SPLIT)
 }
@@ -277,16 +278,16 @@ func GetServiceDependencyRuleRootKey(domainProject string) string {
 func GetServiceDependencyQueueRootKey(domainProject string) string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_SERVICE_KEY,
-		REGISTRY_DEPS_QUEUE_KEY,
+		RegistryServiceKey,
+		RegistryDepsQueueKey,
 		domainProject,
 	}, SPLIT)
 }
 
-func GenerateConsumerDependencyQueueKey(domainProject, consumerId, uuid string) string {
+func GenerateConsumerDependencyQueueKey(domainProject, consumerID, uuid string) string {
 	return util.StringJoin([]string{
 		GetServiceDependencyQueueRootKey(domainProject),
-		consumerId,
+		consumerID,
 		uuid,
 	}, SPLIT)
 }
@@ -294,8 +295,8 @@ func GenerateConsumerDependencyQueueKey(domainProject, consumerId, uuid string)
 func GetServiceDependencyRootKey(domainProject string) string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_SERVICE_KEY,
-		REGISTRY_DEPENDENCY_KEY,
+		RegistryServiceKey,
+		RegistryDependencyKey,
 		domainProject,
 	}, SPLIT)
 }
@@ -303,7 +304,7 @@ func GetServiceDependencyRootKey(domainProject string) string {
 func GetDomainRootKey() string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_DOMAIN_KEY,
+		RegistryDomainKey,
 	}, SPLIT)
 }
 
@@ -329,14 +330,14 @@ func GenerateRBACSecretKey() string {
 func GetServerInfoKey() string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_SYS_KEY,
+		RegistrySysKey,
 	}, SPLIT)
 }
 
 func GetMetricsRootKey() string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_METRICS_KEY,
+		RegistryMetricsKey,
 	}, SPLIT)
 }
 
@@ -352,7 +353,7 @@ func GenerateMetricsKey(name, utc, domain string) string {
 func GetProjectRootKey(domain string) string {
 	return util.StringJoin([]string{
 		GetRootKey(),
-		REGISTRY_PROJECT_KEY,
+		RegistryProjectKey,
 		domain,
 	}, SPLIT)
 }
diff --git a/server/core/microservice.go b/server/core/microservice.go
index 9945a5f..6644b5f 100644
--- a/server/core/microservice.go
+++ b/server/core/microservice.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package core
 
 import (
@@ -35,19 +36,19 @@ var (
 )
 
 const (
-	REGISTRY_DOMAIN         = "default"
-	REGISTRY_PROJECT        = "default"
-	REGISTRY_DOMAIN_PROJECT = "default/default"
+	RegistryDomain        = "default"
+	RegistryProject       = "default"
+	RegistryDomainProject = "default/default"
 
-	REGISTRY_APP_ID        = "default"
-	REGISTRY_SERVICE_NAME  = "SERVICECENTER"
-	REGISTRY_SERVICE_ALIAS = "SERVICECENTER"
+	RegistryAppID        = "default"
+	RegistryServiceName  = "SERVICECENTER"
+	RegistryServiceAlias = "SERVICECENTER"
 
-	REGISTRY_DEFAULT_LEASE_RENEWALINTERVAL int32 = 30
-	REGISTRY_DEFAULT_LEASE_RETRYTIMES      int32 = 3
+	RegistryDefaultLeaseRenewalinterval int32 = 30
+	RegistryDefaultLeaseRetrytimes      int32 = 3
 
-	CTX_SC_SELF     = "_sc_self"
-	CTX_SC_REGISTRY = "_registryOnly"
+	CtxScSelf     = "_sc_self"
+	CtxScRegistry = "_registryOnly"
 )
 
 func init() {
@@ -59,9 +60,9 @@ func init() {
 func prepareSelfRegistration() {
 	Service = &pb.MicroService{
 		Environment: pb.ENV_PROD,
-		AppId:       REGISTRY_APP_ID,
-		ServiceName: REGISTRY_SERVICE_NAME,
-		Alias:       REGISTRY_SERVICE_ALIAS,
+		AppId:       RegistryAppID,
+		ServiceName: RegistryServiceName,
+		Alias:       RegistryServiceAlias,
 		Version:     version.Ver().Version,
 		Status:      pb.MS_UP,
 		Level:       "BACK",
@@ -81,21 +82,21 @@ func prepareSelfRegistration() {
 		Status: pb.MSI_UP,
 		HealthCheck: &pb.HealthCheck{
 			Mode:     pb.CHECK_BY_HEARTBEAT,
-			Interval: REGISTRY_DEFAULT_LEASE_RENEWALINTERVAL,
-			Times:    REGISTRY_DEFAULT_LEASE_RETRYTIMES,
+			Interval: RegistryDefaultLeaseRenewalinterval,
+			Times:    RegistryDefaultLeaseRetrytimes,
 		},
 	}
 }
 
 func AddDefaultContextValue(ctx context.Context) context.Context {
 	return util.SetContext(util.SetContext(util.SetDomainProject(ctx,
-		REGISTRY_DOMAIN, REGISTRY_PROJECT),
-		CTX_SC_SELF, true),
-		CTX_SC_REGISTRY, "1")
+		RegistryDomain, RegistryProject),
+		CtxScSelf, true),
+		CtxScRegistry, "1")
 }
 
 func IsDefaultDomainProject(domainProject string) bool {
-	return domainProject == REGISTRY_DOMAIN_PROJECT
+	return domainProject == RegistryDomainProject
 }
 
 func SetSharedMode() {
@@ -112,7 +113,7 @@ func IsShared(key *pb.MicroServiceKey) bool {
 	if !IsDefaultDomainProject(key.Tenant) {
 		return false
 	}
-	if key.AppId != REGISTRY_APP_ID {
+	if key.AppId != RegistryAppID {
 		return false
 	}
 	_, ok := sharedServiceNames[key.ServiceName]
@@ -123,7 +124,7 @@ func IsShared(key *pb.MicroServiceKey) bool {
 }
 
 func IsSCInstance(ctx context.Context) bool {
-	b, _ := ctx.Value(CTX_SC_SELF).(bool)
+	b, _ := ctx.Value(CtxScSelf).(bool)
 	return b
 }
 
@@ -137,9 +138,9 @@ func GetExistenceRequest() *pb.GetExistenceRequest {
 	}
 }
 
-func GetServiceRequest(serviceId string) *pb.GetServiceRequest {
+func GetServiceRequest(serviceID string) *pb.GetServiceRequest {
 	return &pb.GetServiceRequest{
-		ServiceId: serviceId,
+		ServiceId: serviceID,
 	}
 }
 
diff --git a/server/handler/accesslog/handler.go b/server/handler/accesslog/handler.go
index dab3d5f..46df0b1 100644
--- a/server/handler/accesslog/handler.go
+++ b/server/handler/accesslog/handler.go
@@ -56,24 +56,24 @@ func (h *Handler) ShouldIgnoreAPI(api string) bool {
 
 // Handle handles the request
 func (h *Handler) Handle(i *chain.Invocation) {
-	matchPattern := i.Context().Value(rest.CTX_MATCH_PATTERN).(string)
+	matchPattern := i.Context().Value(rest.CtxMatchPattern).(string)
 	if h.ShouldIgnoreAPI(matchPattern) {
 		i.Next()
 		return
 	}
 	startTimeStr := "unknown"
-	start, ok := i.Context().Value(svr.CTX_START_TIMESTAMP).(time.Time)
+	start, ok := i.Context().Value(svr.CtxStartTimestamp).(time.Time)
 	if ok {
 		startTimeStr = start.Format("2006-01-02T15:04:05.000Z07:00")
 	}
-	r := i.Context().Value(rest.CTX_REQUEST).(*http.Request)
-	w := i.Context().Value(rest.CTX_RESPONSE).(http.ResponseWriter)
+	r := i.Context().Value(rest.CtxRequest).(*http.Request)
+	w := i.Context().Value(rest.CtxResponse).(http.ResponseWriter)
 	i.Next(chain.WithAsyncFunc(func(_ chain.Result) {
 		delayByMillisecond := "unknown"
 		if ok {
 			delayByMillisecond = fmt.Sprintf("%d", time.Since(start)/time.Millisecond)
 		}
-		statusCode := w.Header().Get(rest.HEADER_RESPONSE_STATUS)
+		statusCode := w.Header().Get(rest.HeaderResponseStatus)
 		// format:  remoteIp requestReceiveTime "method requestUri proto" statusCode requestBodySize delay(ms)
 		// example: 127.0.0.1 2006-01-02T15:04:05.000Z07:00 "GET /v4/default/registry/microservices HTTP/1.1" 200 0 0
 		h.logger.Infof("%s %s \"%s %s %s\" %s %d %s",
@@ -92,7 +92,7 @@ func (h *Handler) Handle(i *chain.Invocation) {
 func NewAccessLogHandler(l *log.Logger) *Handler {
 	return &Handler{
 		logger:        l,
-		whiteListAPIs: make(map[string]struct{}, 0)}
+		whiteListAPIs: make(map[string]struct{})}
 }
 
 // RegisterHandlers registers an access log handler to the handler chain
diff --git a/server/handler/accesslog/handler_test.go b/server/handler/accesslog/handler_test.go
index c6edcd3..91fa136 100644
--- a/server/handler/accesslog/handler_test.go
+++ b/server/handler/accesslog/handler_test.go
@@ -26,10 +26,10 @@ func TestHandler(t *testing.T) {
 	inv := &chain.Invocation{}
 	ctx := context.Background()
 	inv.Init(ctx, chain.NewChain("c", []chain.Handler{}))
-	inv.WithContext(rest.CTX_MATCH_PATTERN, "/a")
+	inv.WithContext(rest.CtxMatchPattern, "/a")
 	r, _ := http.NewRequest(http.MethodGet, "http://127.0.0.1:80/a", nil)
 	w := httptest.NewRecorder()
-	inv.WithContext(rest.CTX_REQUEST, r)
-	inv.WithContext(rest.CTX_RESPONSE, w)
+	inv.WithContext(rest.CtxRequest, r)
+	inv.WithContext(rest.CtxResponse, w)
 	h.Handle(inv)
 }
diff --git a/server/handler/auth/auth.go b/server/handler/auth/auth.go
index 6908aff..2b63263 100644
--- a/server/handler/auth/auth.go
+++ b/server/handler/auth/auth.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package auth
 
 import (
@@ -30,7 +31,7 @@ type Handler struct {
 }
 
 func (h *Handler) Handle(i *chain.Invocation) {
-	r := i.Context().Value(rest.CTX_REQUEST).(*http.Request)
+	r := i.Context().Value(rest.CtxRequest).(*http.Request)
 	err := plugin.Plugins().Auth().Identify(r)
 	if err == nil {
 		i.Next()
@@ -39,7 +40,7 @@ func (h *Handler) Handle(i *chain.Invocation) {
 
 	log.Errorf(err, "authenticate request failed, %s %s", r.Method, r.RequestURI)
 
-	w := i.Context().Value(rest.CTX_RESPONSE).(http.ResponseWriter)
+	w := i.Context().Value(rest.CtxResponse).(http.ResponseWriter)
 	controller.WriteError(w, scerror.ErrUnauthorized, err.Error())
 
 	i.Fail(nil)
diff --git a/server/handler/cache/cache.go b/server/handler/cache/cache.go
index c37b414..8d3072f 100644
--- a/server/handler/cache/cache.go
+++ b/server/handler/cache/cache.go
@@ -14,49 +14,49 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package cache
 
 import (
 	"github.com/apache/servicecomb-service-center/pkg/chain"
 	"github.com/apache/servicecomb-service-center/pkg/rest"
 	"github.com/apache/servicecomb-service-center/pkg/util"
-	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
 	"net/http"
 )
 
-type CacheResponse struct {
+type Handler struct {
 }
 
-func (l *CacheResponse) Handle(i *chain.Invocation) {
+func (l *Handler) Handle(i *chain.Invocation) {
 	defer i.Next()
 
-	r := i.Context().Value(rest.CTX_REQUEST).(*http.Request)
+	r := i.Context().Value(rest.CtxRequest).(*http.Request)
 	query := r.URL.Query()
 
-	global := util.StringTRUE(query.Get(serviceUtil.CTX_GLOBAL))
+	global := util.StringTRUE(query.Get(string(util.CtxGlobal)))
 	if global && r.Method == http.MethodGet {
-		i.WithContext(serviceUtil.CTX_GLOBAL, "1")
+		i.WithContext(util.CtxGlobal, "1")
 	}
 
-	noCache := util.StringTRUE(query.Get(serviceUtil.CTX_NOCACHE))
+	noCache := util.StringTRUE(query.Get(util.CtxNocache))
 	if noCache {
-		i.WithContext(serviceUtil.CTX_NOCACHE, "1")
+		i.WithContext(util.CtxNocache, "1")
 		return
 	}
 
-	cacheOnly := util.StringTRUE(query.Get(serviceUtil.CTX_CACHEONLY))
+	cacheOnly := util.StringTRUE(query.Get(string(util.CtxCacheOnly)))
 	if cacheOnly {
-		i.WithContext(serviceUtil.CTX_CACHEONLY, "1")
+		i.WithContext(util.CtxCacheOnly, "1")
 		return
 	}
 
 	rev := query.Get("rev")
 	if len(rev) > 0 {
-		i.WithContext(serviceUtil.CTX_REQUEST_REVISION, rev)
+		i.WithContext(util.CtxRequestRevision, rev)
 		return
 	}
 }
 
 func RegisterHandlers() {
-	chain.RegisterHandler(rest.ServerChainName, &CacheResponse{})
+	chain.RegisterHandler(rest.ServerChainName, &Handler{})
 }
diff --git a/server/handler/context/context.go b/server/handler/context/context.go
index abc705d..ab5217f 100644
--- a/server/handler/context/context.go
+++ b/server/handler/context/context.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package context
 
 import (
@@ -23,16 +24,16 @@ import (
 	"net/http"
 )
 
-type ContextHandler struct {
+type Handler struct {
 }
 
-func (c *ContextHandler) Handle(i *chain.Invocation) {
+func (c *Handler) Handle(i *chain.Invocation) {
 	var (
 		err     error
 		v3      v3Context
 		v4      v4Context
-		r       = i.Context().Value(roa.CTX_REQUEST).(*http.Request)
-		pattern = i.Context().Value(roa.CTX_MATCH_PATTERN).(string)
+		r       = i.Context().Value(roa.CtxRequest).(*http.Request)
+		pattern = i.Context().Value(roa.CtxMatchPattern).(string)
 	)
 
 	switch {
@@ -65,5 +66,5 @@ func IsSkip(url string) bool {
 }
 
 func RegisterHandlers() {
-	chain.RegisterHandler(roa.ServerChainName, &ContextHandler{})
+	chain.RegisterHandler(roa.ServerChainName, &Handler{})
 }
diff --git a/server/handler/context/v3.go b/server/handler/context/v3.go
index 3592fa0..6c838e9 100644
--- a/server/handler/context/v3.go
+++ b/server/handler/context/v3.go
@@ -14,11 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package context
 
 import (
-	"errors"
-	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/core"
 	"net/http"
@@ -44,15 +43,13 @@ func (v *v3Context) Do(r *http.Request) error {
 		}
 
 		if len(domain) == 0 {
-			err := errors.New("Header does not contain domain.")
-			log.Errorf(err, "Invalid Request URI %s", r.RequestURI)
-			return err
+			domain = "default"
 		}
 		util.SetRequestContext(r, util.CtxDomain, domain)
 	}
 
 	if len(project) == 0 {
-		util.SetRequestContext(r, util.CtxProject, core.REGISTRY_PROJECT)
+		util.SetRequestContext(r, util.CtxProject, core.RegistryProject)
 	}
 
 	return nil
diff --git a/server/handler/context/v4.go b/server/handler/context/v4.go
index a74c9e0..6f10157 100644
--- a/server/handler/context/v4.go
+++ b/server/handler/context/v4.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package context
 
 import (
@@ -46,7 +47,7 @@ func (v *v4Context) Do(r *http.Request) error {
 	if len(project) == 0 {
 		project = r.URL.Query().Get(":project")
 		if len(project) == 0 {
-			project = core.REGISTRY_PROJECT
+			project = core.RegistryProject
 		}
 		util.SetRequestContext(r, util.CtxProject, project)
 	}
diff --git a/server/handler/maxbody/maxbody.go b/server/handler/maxbody/maxbody.go
index 26adbe5..2aae8f0 100644
--- a/server/handler/maxbody/maxbody.go
+++ b/server/handler/maxbody/maxbody.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package maxbody
 
 import (
@@ -43,18 +44,18 @@ var resourcesMap = map[string]int64{
 	"/v4/:project/registry/microservices/:serviceId/instances/:instanceId/properties": propertiesSize,
 }
 
-type MaxBodyHandler struct {
+type Handler struct {
 }
 
-func (c *MaxBodyHandler) Handle(i *chain.Invocation) {
-	r := i.Context().Value(rest.CTX_REQUEST).(*http.Request)
+func (c *Handler) Handle(i *chain.Invocation) {
+	r := i.Context().Value(rest.CtxRequest).(*http.Request)
 	if r.Method == http.MethodGet {
 		i.Next()
 		return
 	}
 
-	w, pattern := i.Context().Value(rest.CTX_RESPONSE).(http.ResponseWriter),
-		i.Context().Value(rest.CTX_MATCH_PATTERN).(string)
+	w, pattern := i.Context().Value(rest.CtxResponse).(http.ResponseWriter),
+		i.Context().Value(rest.CtxMatchPattern).(string)
 	v, ok := resourcesMap[pattern]
 	if !ok {
 		v = core.ServerInfo.Config.MaxBodyBytes
@@ -66,5 +67,5 @@ func (c *MaxBodyHandler) Handle(i *chain.Invocation) {
 }
 
 func RegisterHandlers() {
-	chain.RegisterHandler(rest.ServerChainName, &MaxBodyHandler{})
+	chain.RegisterHandler(rest.ServerChainName, &Handler{})
 }
diff --git a/server/handler/metric/metric.go b/server/handler/metric/metric.go
index 1b48ccc..abd8e85 100644
--- a/server/handler/metric/metric.go
+++ b/server/handler/metric/metric.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package metric
 
 import (
@@ -31,14 +32,14 @@ type MetricsHandler struct {
 
 func (h *MetricsHandler) Handle(i *chain.Invocation) {
 	i.Next(chain.WithAsyncFunc(func(ret chain.Result) {
-		start, ok := i.Context().Value(svr.CTX_START_TIMESTAMP).(time.Time)
+		start, ok := i.Context().Value(svr.CtxStartTimestamp).(time.Time)
 		if !ok {
 			return
 		}
-		w, r := i.Context().Value(rest.CTX_RESPONSE).(http.ResponseWriter),
-			i.Context().Value(rest.CTX_REQUEST).(*http.Request)
+		w, r := i.Context().Value(rest.CtxResponse).(http.ResponseWriter),
+			i.Context().Value(rest.CtxRequest).(*http.Request)
 		prometheus.ReportRequestCompleted(w, r, start)
-		log.LogNilOrWarnf(start, "%s %s", r.Method, r.RequestURI)
+		log.NilOrWarnf(start, "%s %s", r.Method, r.RequestURI)
 	}))
 }
 
diff --git a/server/handler/tracing/tracing.go b/server/handler/tracing/tracing.go
index e081c14..4ff9366 100644
--- a/server/handler/tracing/tracing.go
+++ b/server/handler/tracing/tracing.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package tracing
 
 import (
@@ -24,18 +25,18 @@ import (
 	"strconv"
 )
 
-type TracingHandler struct {
+type Handler struct {
 }
 
-func (h *TracingHandler) Handle(i *chain.Invocation) {
-	w, r, op := i.Context().Value(rest.CTX_RESPONSE).(http.ResponseWriter),
-		i.Context().Value(rest.CTX_REQUEST).(*http.Request),
-		i.Context().Value(rest.CTX_MATCH_FUNC).(string)
+func (h *Handler) Handle(i *chain.Invocation) {
+	w, r, op := i.Context().Value(rest.CtxResponse).(http.ResponseWriter),
+		i.Context().Value(rest.CtxRequest).(*http.Request),
+		i.Context().Value(rest.CtxMatchFunc).(string)
 
 	span := plugin.Plugins().Tracing().ServerBegin(op, r)
 
 	i.Next(chain.WithAsyncFunc(func(ret chain.Result) {
-		statusCode := w.Header().Get(rest.HEADER_RESPONSE_STATUS)
+		statusCode := w.Header().Get(rest.HeaderResponseStatus)
 		code, _ := strconv.ParseInt(statusCode, 10, 64)
 		if code == 0 {
 			code = 200
@@ -45,5 +46,5 @@ func (h *TracingHandler) Handle(i *chain.Invocation) {
 }
 
 func RegisterHandlers() {
-	chain.RegisterHandler(rest.ServerChainName, &TracingHandler{})
+	chain.RegisterHandler(rest.ServerChainName, &Handler{})
 }
diff --git a/server/health/health.go b/server/health/health.go
index c2135e2..cbbc19e 100644
--- a/server/health/health.go
+++ b/server/health/health.go
@@ -31,7 +31,7 @@ type DefaultHealthChecker struct {
 
 func (hc *DefaultHealthChecker) Healthy() error {
 	for _, a := range alarm.ListAll() {
-		if a.Id == alarm.IdBackendConnectionRefuse && a.Status != alarm.Cleared {
+		if a.ID == alarm.IDBackendConnectionRefuse && a.Status != alarm.Cleared {
 			return errors.New(a.FieldString(alarm.FieldAdditionalContext))
 		}
 	}
diff --git a/server/health/health_test.go b/server/health/health_test.go
index 09fd52b..afd5786 100644
--- a/server/health/health_test.go
+++ b/server/health/health_test.go
@@ -23,19 +23,19 @@ import (
 )
 
 func TestDefaultHealthChecker_Healthy(t *testing.T) {
-	notify.NotifyCenter().Start()
+	notify.GetNotifyCenter().Start()
 
 	// normal case
 	var hc DefaultHealthChecker
 	if err := hc.Healthy(); err != nil {
 		t.Fatal("TestDefaultHealthChecker_Healthy failed", err)
 	}
-	alarm.Raise(alarm.IdBackendConnectionRefuse, alarm.AdditionalContext("a"))
+	alarm.Raise(alarm.IDBackendConnectionRefuse, alarm.AdditionalContext("a"))
 	time.Sleep(time.Second)
 	if err := hc.Healthy(); err == nil || err.Error() != "a" {
 		t.Fatal("TestDefaultHealthChecker_Healthy failed", err)
 	}
-	alarm.Clear(alarm.IdBackendConnectionRefuse)
+	alarm.Clear(alarm.IDBackendConnectionRefuse)
 	time.Sleep(time.Second)
 	if err := hc.Healthy(); err != nil {
 		t.Fatal("TestDefaultHealthChecker_Healthy failed", err)
diff --git a/server/init/init.go b/server/init/init.go
index b7dfc87..9e0ea3e 100644
--- a/server/init/init.go
+++ b/server/init/init.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package init
 
 import "github.com/apache/servicecomb-service-center/server/core"
diff --git a/server/interceptor/access/access.go b/server/interceptor/access/access.go
index 738cfe2..55fe4e8 100644
--- a/server/interceptor/access/access.go
+++ b/server/interceptor/access/access.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package access
 
 import (
@@ -34,12 +35,15 @@ func init() {
 }
 
 func Intercept(w http.ResponseWriter, r *http.Request) error {
-	w.Header().Add(rest.HEADER_SERVER, serverName)
+	w.Header().Add(rest.HeaderServer, serverName)
 
 	if !validate.IsRequestURI(r.RequestURI) {
 		err := fmt.Errorf("Invalid Request URI %s", r.RequestURI)
 		w.WriteHeader(http.StatusBadRequest)
-		w.Write(util.StringToBytesWithNoCopy(err.Error()))
+		_, err = w.Write(util.StringToBytesWithNoCopy(err.Error()))
+		if err != nil {
+			return err
+		}
 		return err
 	}
 	return nil
diff --git a/server/interceptor/cors/cors.go b/server/interceptor/cors/cors.go
index b906d5b..df868b2 100644
--- a/server/interceptor/cors/cors.go
+++ b/server/interceptor/cors/cors.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package cors
 
 import (
diff --git a/server/interceptor/interceptors.go b/server/interceptor/interceptors.go
index 1aef787..5ae4958 100644
--- a/server/interceptor/interceptors.go
+++ b/server/interceptor/interceptors.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package interceptor
 
 import (
@@ -25,14 +26,14 @@ import (
 
 var interceptors []*Interception
 
-type InterceptorFunc func(http.ResponseWriter, *http.Request) error
+type Intercept func(http.ResponseWriter, *http.Request) error
 
-func (f InterceptorFunc) Name() string {
+func (f Intercept) Name() string {
 	return util.FuncName(f)
 }
 
 type Interception struct {
-	function InterceptorFunc
+	function Intercept
 }
 
 func (i Interception) Invoke(w http.ResponseWriter, req *http.Request) error {
@@ -43,7 +44,7 @@ func init() {
 	interceptors = make([]*Interception, 0, 10)
 }
 
-func RegisterInterceptFunc(intc InterceptorFunc) {
+func RegisterInterceptFunc(intc Intercept) {
 	interceptors = append(interceptors, &Interception{
 		function: intc,
 	})
@@ -55,7 +56,7 @@ func InvokeInterceptors(w http.ResponseWriter, req *http.Request) (err error) {
 	var intc *Interception
 	defer func() {
 		if itf := recover(); itf != nil {
-			log.LogPanic(itf)
+			log.Panic(itf)
 
 			err = errorsEx.RaiseError(itf)
 
diff --git a/server/metric/calculator.go b/server/metric/calculator.go
index fea89dd..f1c4ee7 100644
--- a/server/metric/calculator.go
+++ b/server/metric/calculator.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package metric
 
 import (
diff --git a/server/metric/common.go b/server/metric/common.go
index fc230c4..91ee450 100644
--- a/server/metric/common.go
+++ b/server/metric/common.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package metric
 
 import (
@@ -33,9 +34,9 @@ const (
 )
 
 var (
-	// metrics collect period
+	// Period is metrics collect period
 	Period = 30 * time.Second
-	// system metrics map
+	// SysMetrics map
 	SysMetrics util.ConcurrentMap
 
 	getEndpointOnce sync.Once
@@ -61,17 +62,17 @@ func getPeriod() time.Duration {
 
 func InstanceName() string {
 	getEndpointOnce.Do(func() {
-		restIp := beego.AppConfig.String("httpaddr")
+		restIP := beego.AppConfig.String("httpaddr")
 		restPort := beego.AppConfig.String("httpport")
-		if len(restIp) > 0 {
-			instance = net.JoinHostPort(restIp, restPort)
+		if len(restIP) > 0 {
+			instance = net.JoinHostPort(restIP, restPort)
 			return
 		}
 
-		rpcIp := beego.AppConfig.String("rpcaddr")
+		rpcIP := beego.AppConfig.String("rpcaddr")
 		rpcPort := beego.AppConfig.String("rpcport")
-		if len(rpcIp) > 0 {
-			instance = net.JoinHostPort(rpcIp, rpcPort)
+		if len(rpcIP) > 0 {
+			instance = net.JoinHostPort(rpcIP, rpcPort)
 			return
 		}
 	})
diff --git a/server/metric/gatherer.go b/server/metric/gatherer.go
index 81b6738..7948a9d 100644
--- a/server/metric/gatherer.go
+++ b/server/metric/gatherer.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package metric
 
 import (
diff --git a/server/metric/metrics.go b/server/metric/metrics.go
index ea4c01b..45bb294 100644
--- a/server/metric/metrics.go
+++ b/server/metric/metrics.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package metric
 
 import (
@@ -24,6 +25,9 @@ import (
 	dto "github.com/prometheus/client_model/go"
 )
 
+// Pxx represents p99 p90 p50
+var Pxx = map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}
+
 func NewMetrics() *Metrics {
 	return &Metrics{
 		mapper: make(map[string]*Details),
@@ -80,7 +84,6 @@ func (cm *Details) Get(labels []*dto.LabelPair) (val float64) {
 
 func (cm *Details) put(labels []*dto.LabelPair, val float64) {
 	cm.mapper[cm.toKey(labels)] = val
-	return
 }
 
 func (cm *Details) ForEach(f func(labels []*dto.LabelPair, v float64) (next bool)) {
@@ -123,7 +126,7 @@ func (cm *Metrics) Summary(key string) (sum float64) {
 }
 
 const (
-	tagJson = "json"
+	tagJSON = "json"
 )
 
 // ToRawData parses result form labels
@@ -140,7 +143,7 @@ func ToRawData(result interface{}, labels []*dto.LabelPair) {
 		if elem.Field(i).Type.Kind() != reflect.String {
 			continue
 		}
-		tag := elem.Field(i).Tag.Get(tagJson)
+		tag := elem.Field(i).Tag.Get(tagJSON)
 		for _, label := range labels {
 			if *label.Name == tag {
 				value.Field(i).SetString(*label.Value)
@@ -159,7 +162,7 @@ func ToLabelNames(structure interface{}) []string {
 	num := t.NumField()
 	labelNames := make([]string, 0, num)
 	for i := 0; i < num; i++ {
-		tag := t.Field(i).Tag.Get(tagJson)
+		tag := t.Field(i).Tag.Get(tagJSON)
 		labelNames = append(labelNames, tag)
 	}
 	return labelNames
diff --git a/server/metric/prometheus/metrics.go b/server/metric/prometheus/metrics.go
index f0f5f19..c652804 100644
--- a/server/metric/prometheus/metrics.go
+++ b/server/metric/prometheus/metrics.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package prometheus
 
 import (
@@ -22,6 +23,7 @@ import (
 	"github.com/apache/servicecomb-service-center/server/metric"
 	rest2 "github.com/apache/servicecomb-service-center/server/rest"
 	"github.com/prometheus/client_golang/prometheus"
+	"github.com/prometheus/client_golang/prometheus/promhttp"
 	"net/http"
 	"strconv"
 	"strings"
@@ -51,7 +53,7 @@ var (
 			Subsystem:  "http",
 			Name:       "request_durations_microseconds",
 			Help:       "HTTP request latency summary of ROA handler",
-			Objectives: prometheus.DefObjectives,
+			Objectives: metric.Pxx,
 		}, []string{"method", "instance", "api", "domain"})
 
 	queryPerSeconds = prometheus.NewGaugeVec(
@@ -66,13 +68,13 @@ var (
 func init() {
 	prometheus.MustRegister(incomingRequests, successfulRequests, reqDurations, queryPerSeconds)
 
-	rest2.RegisterServerHandler("/metrics", prometheus.Handler())
+	rest2.RegisterServerHandler("/metrics", promhttp.Handler())
 }
 
 func ReportRequestCompleted(w http.ResponseWriter, r *http.Request, start time.Time) {
 	instance := metric.InstanceName()
 	elapsed := float64(time.Since(start).Nanoseconds()) / float64(time.Microsecond)
-	route, _ := r.Context().Value(rest.CTX_MATCH_FUNC).(string)
+	route, _ := r.Context().Value(rest.CtxMatchFunc).(string)
 	domain := util.ParseDomain(r.Context())
 
 	if strings.Index(r.Method, "WATCH") != 0 {
@@ -89,7 +91,7 @@ func ReportRequestCompleted(w http.ResponseWriter, r *http.Request, start time.T
 }
 
 func codeOf(h http.Header) (bool, string) {
-	statusCode := h.Get(rest.HEADER_RESPONSE_STATUS)
+	statusCode := h.Get(rest.HeaderResponseStatus)
 	if statusCode == "" {
 		return true, "200"
 	}
diff --git a/server/metric/reporter.go b/server/metric/reporter.go
index f86b9f2..decfba4 100644
--- a/server/metric/reporter.go
+++ b/server/metric/reporter.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package metric
 
 import "github.com/apache/servicecomb-service-center/pkg/log"
diff --git a/server/mux/mux.go b/server/mux/mux.go
index 4944d1b..c4f9d79 100644
--- a/server/mux/mux.go
+++ b/server/mux/mux.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package mux
 
 import (
@@ -22,9 +23,9 @@ import (
 	"unsafe"
 )
 
-type MuxType string
+type Type string
 
-func (m *MuxType) String() (s string) {
+func (m *Type) String() (s string) {
 	pMT := (*reflect.StringHeader)(unsafe.Pointer(m))
 	pStr := (*reflect.StringHeader)(unsafe.Pointer(&s))
 	pStr.Data = pMT.Data
@@ -33,15 +34,15 @@ func (m *MuxType) String() (s string) {
 }
 
 const (
-	GlobalLock       MuxType = "/cse-sr/lock/global"
-	DepQueueLock     MuxType = "/cse-sr/lock/dep-queue"
-	ServiceClearLock MuxType = "/cse-sr/lock/service-clear"
+	GlobalLock       Type = "/cse-sr/lock/global"
+	DepQueueLock     Type = "/cse-sr/lock/dep-queue"
+	ServiceClearLock Type = "/cse-sr/lock/service-clear"
 )
 
-func Lock(t MuxType) (*etcdsync.DLock, error) {
+func Lock(t Type) (*etcdsync.DLock, error) {
 	return etcdsync.Lock(t.String(), -1, true)
 }
 
-func Try(t MuxType) (*etcdsync.DLock, error) {
+func Try(t Type) (*etcdsync.DLock, error) {
 	return etcdsync.Lock(t.String(), -1, false)
 }
diff --git a/server/notify/center.go b/server/notify/center.go
index db95ec3..4a0ad80 100644
--- a/server/notify/center.go
+++ b/server/notify/center.go
@@ -20,12 +20,12 @@ import (
 )
 
 var INSTANCE = notify.RegisterType("INSTANCE", InstanceEventQueueSize)
-var notifyService *notify.NotifyService
+var notifyService *notify.Service
 
 func init() {
 	notifyService = notify.NewNotifyService()
 }
 
-func NotifyCenter() *notify.NotifyService {
+func GetNotifyCenter() *notify.Service {
 	return notifyService
 }
diff --git a/server/notify/listwatcher.go b/server/notify/listwatcher.go
index e355492..5b64a8f 100644
--- a/server/notify/listwatcher.go
+++ b/server/notify/listwatcher.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package notify
 
 import (
@@ -41,10 +42,13 @@ type InstanceEventListWatcher struct {
 	listCh       chan struct{}
 }
 
-func (s *InstanceEventListWatcher) SetError(err error) {
-	s.Subscriber.SetError(err)
+func (w *InstanceEventListWatcher) SetError(err error) {
+	w.Subscriber.SetError(err)
 	// 触发清理job
-	s.Service().Publish(notify.NewNotifyServiceHealthCheckJob(s))
+	e := w.Service().Publish(notify.NewNotifyServiceHealthCheckJob(w))
+	if e != nil {
+		log.Error("", e)
+	}
 }
 
 func (w *InstanceEventListWatcher) OnAccept() {
@@ -125,26 +129,26 @@ func (w *InstanceEventListWatcher) Close() {
 	close(w.Job)
 }
 
-func NewInstanceEvent(serviceId, domainProject string, rev int64, response *pb.WatchInstanceResponse) *InstanceEvent {
+func NewInstanceEvent(serviceID, domainProject string, rev int64, response *pb.WatchInstanceResponse) *InstanceEvent {
 	return &InstanceEvent{
-		Event:    notify.NewEvent(INSTANCE, domainProject, serviceId),
+		Event:    notify.NewEvent(INSTANCE, domainProject, serviceID),
 		Revision: rev,
 		Response: response,
 	}
 }
 
-func NewInstanceEventWithTime(serviceId, domainProject string, rev int64, createAt simple.Time, response *pb.WatchInstanceResponse) *InstanceEvent {
+func NewInstanceEventWithTime(serviceID, domainProject string, rev int64, createAt simple.Time, response *pb.WatchInstanceResponse) *InstanceEvent {
 	return &InstanceEvent{
-		Event:    notify.NewEventWithTime(INSTANCE, domainProject, serviceId, createAt),
+		Event:    notify.NewEventWithTime(INSTANCE, domainProject, serviceID, createAt),
 		Revision: rev,
 		Response: response,
 	}
 }
 
-func NewInstanceEventListWatcher(serviceId, domainProject string,
+func NewInstanceEventListWatcher(serviceID, domainProject string,
 	listFunc func() (results []*pb.WatchInstanceResponse, rev int64)) *InstanceEventListWatcher {
 	watcher := &InstanceEventListWatcher{
-		Subscriber: notify.NewSubscriber(INSTANCE, domainProject, serviceId),
+		Subscriber: notify.NewSubscriber(INSTANCE, domainProject, serviceID),
 		Job:        make(chan *InstanceEvent, INSTANCE.QueueSize()),
 		ListFunc:   listFunc,
 		listCh:     make(chan struct{}),
diff --git a/server/notify/metrics.go b/server/notify/metrics.go
index 39d88c3..6bde05b 100644
--- a/server/notify/metrics.go
+++ b/server/notify/metrics.go
@@ -42,7 +42,7 @@ var (
 			Subsystem:  "notify",
 			Name:       "publish_durations_microseconds",
 			Help:       "Latency of publishing instance events",
-			Objectives: prometheus.DefObjectives,
+			Objectives: metric.Pxx,
 		}, []string{"instance", "source", "status"})
 
 	subscriberGauge = prometheus.NewGaugeVec(
diff --git a/server/notify/publisher.go b/server/notify/publisher.go
index 7970192..aa1c662 100644
--- a/server/notify/publisher.go
+++ b/server/notify/publisher.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package notify
 
 import (
diff --git a/server/notify/stream.go b/server/notify/stream.go
index 705323b..25b18a7 100644
--- a/server/notify/stream.go
+++ b/server/notify/stream.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package notify
 
 import (
@@ -44,31 +45,32 @@ func HandleWatchJob(watcher *InstanceEventListWatcher, stream pb.ServiceInstance
 					watcher.Subject(), watcher.Group())
 				return
 			}
-			resp := job.Response
-			log.Infof("event is coming in, watcher, subject: %s, group: %s",
-				watcher.Subject(), watcher.Group())
-
-			err = stream.Send(resp)
-			if job != nil {
-				ReportPublishCompleted(job, err)
-			}
-			if err != nil {
-				log.Errorf(err, "send message error, subject: %s, group: %s",
+			if job.Response != nil {
+				resp := job.Response
+				log.Infof("event is coming in, watcher, subject: %s, group: %s",
 					watcher.Subject(), watcher.Group())
-				watcher.SetError(err)
-				return
-			}
 
-			util.ResetTimer(timer, HeartbeatInterval)
+				err = stream.Send(resp)
+				if job != nil {
+					ReportPublishCompleted(job, err)
+				}
+				if err != nil {
+					log.Errorf(err, "send message error, subject: %s, group: %s",
+						watcher.Subject(), watcher.Group())
+					watcher.SetError(err)
+					return
+				}
+				util.ResetTimer(timer, HeartbeatInterval)
+			}
 		}
 	}
 }
 
-func DoStreamListAndWatch(ctx context.Context, serviceId string, f func() ([]*pb.WatchInstanceResponse, int64), stream pb.ServiceInstanceCtrl_WatchServer) (err error) {
+func DoStreamListAndWatch(ctx context.Context, serviceID string, f func() ([]*pb.WatchInstanceResponse, int64), stream pb.ServiceInstanceCtrl_WatchServer) (err error) {
 	domainProject := util.ParseDomainProject(ctx)
 	domain := util.ParseDomain(ctx)
-	watcher := NewInstanceEventListWatcher(serviceId, apt.GetInstanceRootKey(domainProject)+"/", f)
-	err = NotifyCenter().AddSubscriber(watcher)
+	watcher := NewInstanceEventListWatcher(serviceID, apt.GetInstanceRootKey(domainProject)+"/", f)
+	err = GetNotifyCenter().AddSubscriber(watcher)
 	if err != nil {
 		return
 	}
diff --git a/server/notify/websocket.go b/server/notify/websocket.go
index 48acc39..ceccf39 100644
--- a/server/notify/websocket.go
+++ b/server/notify/websocket.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package notify
 
 import (
@@ -50,7 +51,7 @@ func (wh *WebSocket) Init() error {
 	remoteAddr := wh.conn.RemoteAddr().String()
 
 	// put in notification service queue
-	if err := NotifyCenter().AddSubscriber(wh.watcher); err != nil {
+	if err := GetNotifyCenter().AddSubscriber(wh.watcher); err != nil {
 		err = fmt.Errorf("establish[%s] websocket watch failed: notify service error, %s",
 			remoteAddr, err.Error())
 		log.Errorf(nil, err.Error())
@@ -97,7 +98,12 @@ func (wh *WebSocket) HandleWatchWebSocketControlMessage() {
 	remoteAddr := wh.conn.RemoteAddr().String()
 	// PING
 	wh.conn.SetPingHandler(func(message string) error {
-		defer wh.conn.SetReadDeadline(time.Now().Add(wh.ReadTimeout()))
+		defer func() {
+			err := wh.conn.SetReadDeadline(time.Now().Add(wh.ReadTimeout()))
+			if err != nil {
+				log.Error("", err)
+			}
+		}()
 		if wh.needPingWatcher {
 			log.Infof("received 'Ping' message '%s' from watcher[%s], no longer send 'Ping' to it, subject: %s, group: %s",
 				message, remoteAddr, wh.watcher.Subject(), wh.watcher.Group())
@@ -107,7 +113,12 @@ func (wh *WebSocket) HandleWatchWebSocketControlMessage() {
 	})
 	// PONG
 	wh.conn.SetPongHandler(func(message string) error {
-		defer wh.conn.SetReadDeadline(time.Now().Add(wh.ReadTimeout()))
+		defer func() {
+			err := wh.conn.SetReadDeadline(time.Now().Add(wh.ReadTimeout()))
+			if err != nil {
+				log.Error("", err)
+			}
+		}()
 		log.Debugf("received 'Pong' message '%s' from watcher[%s], subject: %s, group: %s",
 			message, remoteAddr, wh.watcher.Subject(), wh.watcher.Group())
 		return nil
@@ -120,7 +131,10 @@ func (wh *WebSocket) HandleWatchWebSocketControlMessage() {
 	})
 
 	wh.conn.SetReadLimit(ReadMaxBody)
-	wh.conn.SetReadDeadline(time.Now().Add(wh.ReadTimeout()))
+	err := wh.conn.SetReadDeadline(time.Now().Add(wh.ReadTimeout()))
+	if err != nil {
+		log.Error("", err)
+	}
 	for {
 		_, _, err := wh.conn.ReadMessage()
 		if err != nil {
@@ -182,13 +196,12 @@ func (wh *WebSocket) HandleWatchWebSocketJob(o interface{}) {
 		remoteAddr = wh.conn.RemoteAddr().String()
 	)
 
-	switch o.(type) {
+	switch o := o.(type) {
 	case error:
-		err := o.(error)
-		log.Errorf(err, "watcher[%s] catch an err, subject: %s, group: %s",
+		log.Errorf(o, "watcher[%s] catch an err, subject: %s, group: %s",
 			remoteAddr, wh.watcher.Subject(), wh.watcher.Group())
 
-		message = util.StringToBytesWithNoCopy(fmt.Sprintf("watcher catch an err: %s", err.Error()))
+		message = util.StringToBytesWithNoCopy(fmt.Sprintf("watcher catch an err: %s", o.Error()))
 	case time.Time:
 		domainProject := util.ParseDomainProject(wh.ctx)
 		if !serviceUtil.ServiceExist(wh.ctx, domainProject, wh.watcher.Group()) {
@@ -210,8 +223,7 @@ func (wh *WebSocket) HandleWatchWebSocketJob(o interface{}) {
 			remoteAddr, wh.watcher.Subject(), wh.watcher.Group())
 		return
 	case *InstanceEvent:
-		job = o.(*InstanceEvent)
-		resp := job.Response
+		resp := o.Response
 
 		providerFlag := fmt.Sprintf("%s/%s/%s", resp.Key.AppId, resp.Key.ServiceName, resp.Key.Version)
 		if resp.Action != string(pb.EVT_EXPIRE) {
@@ -252,7 +264,10 @@ func (wh *WebSocket) HandleWatchWebSocketJob(o interface{}) {
 }
 
 func (wh *WebSocket) WriteMessage(message []byte) error {
-	wh.conn.SetWriteDeadline(time.Now().Add(wh.SendTimeout()))
+	err := wh.conn.SetWriteDeadline(time.Now().Add(wh.SendTimeout()))
+	if err != nil {
+		return err
+	}
 	return wh.conn.WriteMessage(websocket.TextMessage, message)
 }
 
@@ -271,13 +286,13 @@ func (wh *WebSocket) Stop() {
 	close(wh.closed)
 }
 
-func DoWebSocketListAndWatch(ctx context.Context, serviceId string, f func() ([]*pb.WatchInstanceResponse, int64), conn *websocket.Conn) {
+func DoWebSocketListAndWatch(ctx context.Context, serviceID string, f func() ([]*pb.WatchInstanceResponse, int64), conn *websocket.Conn) {
 	domainProject := util.ParseDomainProject(ctx)
 	domain := util.ParseDomain(ctx)
 	socket := &WebSocket{
 		ctx:     ctx,
 		conn:    conn,
-		watcher: NewInstanceEventListWatcher(serviceId, domainProject, f),
+		watcher: NewInstanceEventListWatcher(serviceID, domainProject, f),
 	}
 
 	ReportSubscriber(domain, Websocket, 1)
diff --git a/server/notify/websocket_test.go b/server/notify/websocket_test.go
index 9796e2b..14fa2c5 100644
--- a/server/notify/websocket_test.go
+++ b/server/notify/websocket_test.go
@@ -85,7 +85,7 @@ func TestDoWebSocketListAndWatch(t *testing.T) {
 		t.Fatalf("TestPublisher_Run")
 	}
 
-	NotifyCenter().Start()
+	GetNotifyCenter().Start()
 
 	go func() {
 		DoWebSocketListAndWatch(context.Background(), "", nil, conn)
@@ -109,7 +109,7 @@ func TestDoWebSocketListAndWatch(t *testing.T) {
 	w.OnMessage(nil)
 	w.OnMessage(&InstanceEvent{})
 
-	NotifyCenter().Publish(NewInstanceEvent("g", "s", 1, &proto.WatchInstanceResponse{
+	GetNotifyCenter().Publish(NewInstanceEvent("g", "s", 1, &proto.WatchInstanceResponse{
 		Response: proto.CreateResponse(proto.Response_SUCCESS, "ok"),
 		Action:   string(proto.EVT_CREATE),
 		Key:      &proto.MicroServiceKey{},
diff --git a/server/plugin/auditlog/auditlog.go b/server/plugin/auditlog/auditlog.go
index e8127ad..1fab926 100644
--- a/server/plugin/auditlog/auditlog.go
+++ b/server/plugin/auditlog/auditlog.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package auditlog
 
 import "net/http"
diff --git a/server/plugin/auth/auth.go b/server/plugin/auth/auth.go
index 7632600..f55a806 100644
--- a/server/plugin/auth/auth.go
+++ b/server/plugin/auth/auth.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package auth
 
 import (
diff --git a/server/plugin/auth/buildin/buildin.go b/server/plugin/auth/buildin/buildin.go
index 901715e..3f597f7 100644
--- a/server/plugin/auth/buildin/buildin.go
+++ b/server/plugin/auth/buildin/buildin.go
@@ -14,10 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package buildin
 
 import (
-	"context"
 	"errors"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	mgr "github.com/apache/servicecomb-service-center/server/plugin"
@@ -63,8 +63,7 @@ func (ba *TokenAuthenticator) Identify(req *http.Request) error {
 		log.Errorf(err, "authenticate request failed, %s %s", req.Method, req.RequestURI)
 		return err
 	}
-	log.Info("user access")
-	req2 := req.WithContext(context.WithValue(req.Context(), "accountInfo", claims))
+	req2 := req.WithContext(rbac.NewContext(req.Context(), claims))
 	*req = *req2
 	return nil
 }
diff --git a/server/plugin/discovery/aggregate/adaptor.go b/server/plugin/discovery/aggregate/adaptor.go
index 6f158c3..956a0fa 100644
--- a/server/plugin/discovery/aggregate/adaptor.go
+++ b/server/plugin/discovery/aggregate/adaptor.go
@@ -63,22 +63,22 @@ func (as *Aggregator) Ready() <-chan struct{} {
 
 func getLogConflictFunc(t discovery.Type) func(origin, conflict *discovery.KeyValue) {
 	switch t {
-	case backend.SERVICE_INDEX:
+	case backend.ServiceIndex:
 		return func(origin, conflict *discovery.KeyValue) {
-			if serviceId, conflictId := origin.Value.(string), conflict.Value.(string); conflictId != serviceId {
+			if serviceID, conflictID := origin.Value.(string), conflict.Value.(string); conflictID != serviceID {
 				key := core.GetInfoFromSvcIndexKV(conflict.Key)
 				log.Warnf("conflict! can not merge microservice index[%s][%s][%s/%s/%s/%s], found one[%s] in cluster[%s]",
-					conflict.ClusterName, conflictId, key.Environment, key.AppId, key.ServiceName, key.Version,
-					serviceId, origin.ClusterName)
+					conflict.ClusterName, conflictID, key.Environment, key.AppId, key.ServiceName, key.Version,
+					serviceID, origin.ClusterName)
 			}
 		}
-	case backend.SERVICE_ALIAS:
+	case backend.ServiceAlias:
 		return func(origin, conflict *discovery.KeyValue) {
-			if serviceId, conflictId := origin.Value.(string), conflict.Value.(string); conflictId != serviceId {
+			if serviceID, conflictID := origin.Value.(string), conflict.Value.(string); conflictID != serviceID {
 				key := core.GetInfoFromSvcAliasKV(conflict.Key)
 				log.Warnf("conflict! can not merge microservice alias[%s][%s][%s/%s/%s/%s], found one[%s] in cluster[%s]",
-					conflict.ClusterName, conflictId, key.Environment, key.AppId, key.ServiceName, key.Version,
-					serviceId, origin.ClusterName)
+					conflict.ClusterName, conflictID, key.Environment, key.AppId, key.ServiceName, key.Version,
+					serviceID, origin.ClusterName)
 			}
 		}
 	}
@@ -94,7 +94,7 @@ func NewAggregator(t discovery.Type, cfg *discovery.Config) *Aggregator {
 	as.Indexer = NewAggregatorIndexer(as)
 
 	switch t {
-	case backend.SERVICE_INDEX, backend.SERVICE_ALIAS:
+	case backend.ServiceIndex, backend.ServiceAlias:
 		NewConflictChecker(as.Cache(), getLogConflictFunc(t))
 	}
 	return as
diff --git a/server/plugin/discovery/aggregate/cache.go b/server/plugin/discovery/aggregate/cache.go
index 82de3b8..d7a935a 100644
--- a/server/plugin/discovery/aggregate/cache.go
+++ b/server/plugin/discovery/aggregate/cache.go
@@ -79,7 +79,7 @@ func (c Cache) append(tmp []*discovery.KeyValue, arr *[]*discovery.KeyValue,
 		if arr != nil {
 			*arr = append(*arr, kv)
 		}
-		s += 1
+		s++
 	}
 	return
 }
diff --git a/server/plugin/discovery/aggregate/repo.go b/server/plugin/discovery/aggregate/repo.go
index 0a8b5bd..6b69d6f 100644
--- a/server/plugin/discovery/aggregate/repo.go
+++ b/server/plugin/discovery/aggregate/repo.go
@@ -22,19 +22,19 @@ import (
 )
 
 func init() {
-	mgr.RegisterPlugin(mgr.Plugin{mgr.DISCOVERY, Aggregate, NewRepository})
+	mgr.RegisterPlugin(mgr.Plugin{PName: mgr.DISCOVERY, Name: Aggregate, New: NewRepository})
 }
 
-type AggregateRepository struct {
+type Repository struct {
 }
 
-func (r *AggregateRepository) New(t discovery.Type, cfg *discovery.Config) discovery.Adaptor {
+func (r *Repository) New(t discovery.Type, cfg *discovery.Config) discovery.Adaptor {
 	return NewAggregator(t, cfg)
 }
 
 func NewRepository() mgr.Instance {
 	InitConfigs()
-	return &AggregateRepository{}
+	return &Repository{}
 }
 
 func InitConfigs() {
diff --git a/server/plugin/discovery/cache_kv.go b/server/plugin/discovery/cache_kv.go
index 9ae67cc..d8b1955 100644
--- a/server/plugin/discovery/cache_kv.go
+++ b/server/plugin/discovery/cache_kv.go
@@ -48,7 +48,7 @@ func (c *KvCache) Get(key string) (v *KeyValue) {
 	c.rwMux.RLock()
 	prefix := c.prefix(key)
 	if p, ok := c.store[prefix]; ok {
-		v, _ = p[key]
+		v = p[key]
 	}
 	c.rwMux.RUnlock()
 	return
diff --git a/server/plugin/discovery/common.go b/server/plugin/discovery/common.go
index eccaaa5..39232aa 100644
--- a/server/plugin/discovery/common.go
+++ b/server/plugin/discovery/common.go
@@ -21,6 +21,6 @@ import (
 )
 
 const (
-	DEFAULT_TIMEOUT         = 30 * time.Second
-	DEFAULT_CACHE_INIT_SIZE = 100
+	DefaultTimeout       = 30 * time.Second
+	DefaultCacheInitSize = 100
 )
diff --git a/server/plugin/discovery/config.go b/server/plugin/discovery/config.go
index af19650..5590861 100644
--- a/server/plugin/discovery/config.go
+++ b/server/plugin/discovery/config.go
@@ -88,9 +88,9 @@ func (cfg *Config) WithParser(parser pb.Parser) *Config {
 func Configure() *Config {
 	return &Config{
 		Key:      "/",
-		Timeout:  DEFAULT_TIMEOUT,
+		Timeout:  DefaultTimeout,
 		Period:   time.Second,
-		InitSize: DEFAULT_CACHE_INIT_SIZE,
+		InitSize: DefaultCacheInitSize,
 		Parser:   pb.BytesParser,
 	}
 }
diff --git a/server/plugin/discovery/etcd/adaptor.go b/server/plugin/discovery/etcd/adaptor.go
index 4b13517..fcc5302 100644
--- a/server/plugin/discovery/etcd/adaptor.go
+++ b/server/plugin/discovery/etcd/adaptor.go
@@ -22,34 +22,34 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/discovery"
 )
 
-// EtcdAdaptor implements discovery.Adaptor.
-// EtcdAdaptor does service discovery with etcd as it's registry.
-type EtcdAdaptor struct {
+// Adaptor implements discovery.Adaptor.
+// Adaptor does service discovery with etcd as it's registry.
+type Adaptor struct {
 	discovery.Cacher
 	discovery.Indexer
 }
 
-func (se *EtcdAdaptor) Run() {
+func (se *Adaptor) Run() {
 	if r, ok := se.Cacher.(discovery.Runnable); ok {
 		r.Run()
 	}
 }
 
-func (se *EtcdAdaptor) Stop() {
+func (se *Adaptor) Stop() {
 	if r, ok := se.Cacher.(discovery.Runnable); ok {
 		r.Stop()
 	}
 }
 
-func (se *EtcdAdaptor) Ready() <-chan struct{} {
+func (se *Adaptor) Ready() <-chan struct{} {
 	if r, ok := se.Cacher.(discovery.Runnable); ok {
 		return r.Ready()
 	}
 	return closedCh
 }
 
-func NewEtcdAdaptor(name string, cfg *discovery.Config) *EtcdAdaptor {
-	var adaptor EtcdAdaptor
+func NewEtcdAdaptor(name string, cfg *discovery.Config) *Adaptor {
+	var adaptor Adaptor
 	switch {
 	case core.ServerInfo.Config.EnableCache && cfg.InitSize > 0:
 		cache := discovery.NewKvCache(name, cfg)
diff --git a/server/plugin/discovery/etcd/adaptor_test.go b/server/plugin/discovery/etcd/adaptor_test.go
index 64f1011..da04c07 100644
--- a/server/plugin/discovery/etcd/adaptor_test.go
+++ b/server/plugin/discovery/etcd/adaptor_test.go
@@ -25,7 +25,7 @@ import (
 func TestNewKvEntity(t *testing.T) {
 	core.ServerInfo.Config.EnableCache = false
 	i := NewEtcdAdaptor("a", discovery.Configure().WithInitSize(1))
-	if _, ok := i.Indexer.(*EtcdIndexer); !ok {
+	if _, ok := i.Indexer.(*Indexer); !ok {
 		t.Fatalf("TestNewIndexer failed")
 	}
 	core.ServerInfo.Config.EnableCache = true
@@ -35,7 +35,7 @@ func TestNewKvEntity(t *testing.T) {
 	i.Stop()
 
 	i = NewEtcdAdaptor("a", discovery.Configure().WithInitSize(0))
-	if _, ok := i.Indexer.(*EtcdIndexer); !ok {
+	if _, ok := i.Indexer.(*Indexer); !ok {
 		t.Fatalf("TestNewIndexer failed")
 	}
 
@@ -50,8 +50,8 @@ func TestNewKvEntity(t *testing.T) {
 
 func TestNewRepository(t *testing.T) {
 	repo := NewRepository()
-	i := repo.(*EtcdRepository).New(0, discovery.Configure())
-	if _, ok := i.(*EtcdAdaptor); !ok {
+	i := repo.(*Repository).New(0, discovery.Configure())
+	if _, ok := i.(*Adaptor); !ok {
 		t.Fatalf("TestNewIndexer failed")
 	}
 }
diff --git a/server/plugin/discovery/etcd/cacher_kv.go b/server/plugin/discovery/etcd/cacher_kv.go
index 2015466..8b0f23a 100644
--- a/server/plugin/discovery/etcd/cacher_kv.go
+++ b/server/plugin/discovery/etcd/cacher_kv.go
@@ -64,7 +64,7 @@ func (c *KvCacher) needList() bool {
 		return true
 	}
 	c.reListCount++
-	if c.reListCount < DEFAULT_FORCE_LIST_INTERVAL {
+	if c.reListCount < DefaultForceListInterval {
 		return false
 	}
 	c.reListCount = 0
@@ -80,7 +80,7 @@ func (c *KvCacher) doList(cfg ListWatchConfig) error {
 	rev := c.lw.Revision()
 	kvs := resp.Kvs
 	start := time.Now()
-	defer log.LogDebugOrWarnf(start, "finish to cache key %s, %d items, rev: %d",
+	defer log.DebugOrWarnf(start, "finish to cache key %s, %d items, rev: %d",
 		c.Cfg.Key, len(kvs), rev)
 
 	// just reset the cacher if cache marked dirty
@@ -188,7 +188,7 @@ func (c *KvCacher) handleWatcher(watcher Watcher) error {
 			evts = append(evts, evt)
 		}
 		c.sync(evts)
-		log.LogDebugOrWarnf(start, "finish to handle %d events, prefix: %s, rev: %d",
+		log.DebugOrWarnf(start, "finish to handle %d events, prefix: %s, rev: %d",
 			len(evts), c.Cfg.Key, rev)
 	}
 	return nil
@@ -496,7 +496,7 @@ func (c *KvCacher) reportMetrics(ctx context.Context) {
 	if !core.ServerInfo.Config.EnablePProf {
 		return
 	}
-	timer := time.NewTimer(DEFAULT_METRICS_INTERVAL)
+	timer := time.NewTimer(DefaultMetricsInterval)
 	defer timer.Stop()
 	for {
 		select {
@@ -504,7 +504,7 @@ func (c *KvCacher) reportMetrics(ctx context.Context) {
 			return
 		case <-timer.C:
 			ReportCacheSize(c.cache.Name(), "raw", c.cache.Size())
-			timer.Reset(DEFAULT_METRICS_INTERVAL)
+			timer.Reset(DefaultMetricsInterval)
 		}
 	}
 }
diff --git a/server/plugin/discovery/etcd/cacher_kv_test.go b/server/plugin/discovery/etcd/cacher_kv_test.go
index 67b183c..ec9750c 100644
--- a/server/plugin/discovery/etcd/cacher_kv_test.go
+++ b/server/plugin/discovery/etcd/cacher_kv_test.go
@@ -152,11 +152,11 @@ func TestNewKvCacher(t *testing.T) {
 	}
 
 	// case re-list and over no event times
-	for i := 0; i < DEFAULT_FORCE_LIST_INTERVAL; i++ {
+	for i := 0; i < DefaultForceListInterval; i++ {
 		lw.Bus <- nil
 	}
 	evt.KV = nil
-	for i := 0; i < DEFAULT_FORCE_LIST_INTERVAL; i++ {
+	for i := 0; i < DefaultForceListInterval; i++ {
 		cr.refresh(ctx)
 	}
 	// check event
@@ -170,11 +170,11 @@ func TestNewKvCacher(t *testing.T) {
 	}
 
 	lw.ListResponse = &registry.PluginResponse{Revision: 5}
-	for i := 0; i < DEFAULT_FORCE_LIST_INTERVAL; i++ {
+	for i := 0; i < DefaultForceListInterval; i++ {
 		lw.Bus <- nil
 	}
 	evt.KV = nil
-	for i := 0; i < DEFAULT_FORCE_LIST_INTERVAL; i++ {
+	for i := 0; i < DefaultForceListInterval; i++ {
 		cr.refresh(ctx)
 	}
 	// check event
diff --git a/server/plugin/discovery/etcd/common.go b/server/plugin/discovery/etcd/common.go
index 755523d..030784c 100644
--- a/server/plugin/discovery/etcd/common.go
+++ b/server/plugin/discovery/etcd/common.go
@@ -24,8 +24,8 @@ import (
 
 const (
 	// force re-list
-	DEFAULT_FORCE_LIST_INTERVAL = 4
-	DEFAULT_METRICS_INTERVAL    = 30 * time.Second
+	DefaultForceListInterval = 4
+	DefaultMetricsInterval   = 30 * time.Second
 
 	minWaitInterval = 1 * time.Second
 	eventBlockSize  = 1000
diff --git a/server/plugin/discovery/etcd/indexer_cache.go b/server/plugin/discovery/etcd/indexer_cache.go
index 0c37d05..4afa847 100644
--- a/server/plugin/discovery/etcd/indexer_cache.go
+++ b/server/plugin/discovery/etcd/indexer_cache.go
@@ -30,7 +30,7 @@ import (
 // CacheIndexer searches data from etcd cache(firstly) and
 // etcd server(secondly).
 type CacheIndexer struct {
-	*EtcdIndexer
+	*Indexer
 	*discovery.CacheIndexer
 }
 
@@ -39,7 +39,7 @@ func (i *CacheIndexer) Search(ctx context.Context, opts ...registry.PluginOpOpti
 	key := util.BytesToStringWithNoCopy(op.Key)
 
 	if op.NoCache() {
-		return i.EtcdIndexer.Search(ctx, opts...)
+		return i.Indexer.Search(ctx, opts...)
 	}
 
 	if err := i.CheckPrefix(key); err != nil {
@@ -54,17 +54,17 @@ func (i *CacheIndexer) Search(ctx context.Context, opts ...registry.PluginOpOpti
 	if resp.Count > 0 || op.CacheOnly() {
 		return resp, nil
 	}
-	return i.EtcdIndexer.Search(ctx, opts...)
+	return i.Indexer.Search(ctx, opts...)
 }
 
 // Creditable implements discovery.Indexer.Creditable.
 func (i *CacheIndexer) Creditable() bool {
-	return i.EtcdIndexer.Creditable()
+	return i.Indexer.Creditable()
 }
 
 func NewCacheIndexer(cfg *discovery.Config, cache discovery.Cache) *CacheIndexer {
 	return &CacheIndexer{
-		EtcdIndexer:  NewEtcdIndexer(cfg.Key, cfg.Parser),
+		Indexer:      NewEtcdIndexer(cfg.Key, cfg.Parser),
 		CacheIndexer: discovery.NewCacheIndexer(cache),
 	}
 }
diff --git a/server/plugin/discovery/etcd/indexer_etcd.go b/server/plugin/discovery/etcd/indexer_etcd.go
index 57387ad..3e6d3a9 100644
--- a/server/plugin/discovery/etcd/indexer_etcd.go
+++ b/server/plugin/discovery/etcd/indexer_etcd.go
@@ -30,22 +30,22 @@ import (
 	"context"
 )
 
-// EtcdIndexer implements discovery.Indexer.
-// EtcdIndexer searches data from etcd server.
-type EtcdIndexer struct {
+// Indexer implements discovery.Indexer.
+// Indexer searches data from etcd server.
+type Indexer struct {
 	Client registry.Registry
 	Parser pb.Parser
 	Root   string
 }
 
-func (i *EtcdIndexer) CheckPrefix(key string) error {
+func (i *Indexer) CheckPrefix(key string) error {
 	if strings.Index(key, i.Root) != 0 {
 		return fmt.Errorf("search '%s' mismatch pattern %s", key, i.Root)
 	}
 	return nil
 }
 
-func (i *EtcdIndexer) Search(ctx context.Context, opts ...registry.PluginOpOption) (r *discovery.Response, err error) {
+func (i *Indexer) Search(ctx context.Context, opts ...registry.PluginOpOption) (r *discovery.Response, err error) {
 	op := registry.OpGet(opts...)
 	key := util.BytesToStringWithNoCopy(op.Key)
 
@@ -84,10 +84,10 @@ func (i *EtcdIndexer) Search(ctx context.Context, opts ...registry.PluginOpOptio
 }
 
 // Creditable implements discovery.Indexer.Creditable.
-func (i *EtcdIndexer) Creditable() bool {
+func (i *Indexer) Creditable() bool {
 	return true
 }
 
-func NewEtcdIndexer(root string, p pb.Parser) (indexer *EtcdIndexer) {
-	return &EtcdIndexer{Client: backend.Registry(), Parser: p, Root: root}
+func NewEtcdIndexer(root string, p pb.Parser) (indexer *Indexer) {
+	return &Indexer{Client: backend.Registry(), Parser: p, Root: root}
 }
diff --git a/server/plugin/discovery/etcd/indexer_test.go b/server/plugin/discovery/etcd/indexer_test.go
index a6a567d..dd100fe 100644
--- a/server/plugin/discovery/etcd/indexer_test.go
+++ b/server/plugin/discovery/etcd/indexer_test.go
@@ -28,7 +28,7 @@ import (
 func TestEtcdIndexer_Search(t *testing.T) {
 	data := &registry.PluginResponse{Revision: 1}
 	c := &mockRegistry{}
-	i := &EtcdIndexer{Client: c, Root: "/", Parser: pb.BytesParser}
+	i := &Indexer{Client: c, Root: "/", Parser: pb.BytesParser}
 
 	// case: key does not contain prefix
 	resp, err := i.Search(context.Background(), registry.WithStrKey("a"))
@@ -87,7 +87,7 @@ func TestCacheIndexer_Search(t *testing.T) {
 		Count:    1,
 	}}
 	i := &CacheIndexer{
-		EtcdIndexer: &EtcdIndexer{
+		Indexer: &Indexer{
 			Root:   "/",
 			Client: cli,
 		},
diff --git a/server/plugin/discovery/etcd/listwatch_inner.go b/server/plugin/discovery/etcd/listwatch_inner.go
index 2d2529b..e7aa7f8 100644
--- a/server/plugin/discovery/etcd/listwatch_inner.go
+++ b/server/plugin/discovery/etcd/listwatch_inner.go
@@ -31,7 +31,8 @@ type innerListWatch struct {
 }
 
 func (lw *innerListWatch) List(op ListWatchConfig) (*registry.PluginResponse, error) {
-	otCtx, _ := context.WithTimeout(op.Context, op.Timeout)
+	otCtx, cancel := context.WithTimeout(op.Context, op.Timeout)
+	defer cancel()
 	resp, err := lw.Client.Do(otCtx, registry.WatchPrefixOpOptions(lw.Prefix)...)
 	if err != nil {
 		log.Errorf(err, "list prefix %s failed, current rev: %d", lw.Prefix, lw.Revision())
diff --git a/server/plugin/discovery/etcd/listwatch_test.go b/server/plugin/discovery/etcd/listwatch_test.go
index cc51475..c1e1b83 100644
--- a/server/plugin/discovery/etcd/listwatch_test.go
+++ b/server/plugin/discovery/etcd/listwatch_test.go
@@ -27,7 +27,7 @@ import (
 )
 
 type mockRegistry struct {
-	*buildin.BuildinRegistry
+	*buildin.Registry
 	Response *registry.PluginResponse
 }
 
diff --git a/server/plugin/discovery/etcd/repo.go b/server/plugin/discovery/etcd/repo.go
index 90a03e8..e2c7dea 100644
--- a/server/plugin/discovery/etcd/repo.go
+++ b/server/plugin/discovery/etcd/repo.go
@@ -22,20 +22,20 @@ import (
 )
 
 func init() {
-	mgr.RegisterPlugin(mgr.Plugin{mgr.DISCOVERY, "buildin", NewRepository})
-	mgr.RegisterPlugin(mgr.Plugin{mgr.DISCOVERY, "etcd", NewRepository})
+	mgr.RegisterPlugin(mgr.Plugin{PName: mgr.DISCOVERY, Name: "buildin", New: NewRepository})
+	mgr.RegisterPlugin(mgr.Plugin{PName: mgr.DISCOVERY, Name: "etcd", New: NewRepository})
 }
 
-type EtcdRepository struct {
+type Repository struct {
 }
 
-func (r *EtcdRepository) New(t discovery.Type, cfg *discovery.Config) discovery.Adaptor {
+func (r *Repository) New(t discovery.Type, cfg *discovery.Config) discovery.Adaptor {
 	return NewEtcdAdaptor(t.String(), cfg)
 }
 
 func NewRepository() mgr.Instance {
 	InitConfigs()
-	return &EtcdRepository{}
+	return &Repository{}
 }
 
 func InitConfigs() {
diff --git a/server/plugin/discovery/etcd/watcher_inner.go b/server/plugin/discovery/etcd/watcher_inner.go
index 0b434d2..87ed82e 100644
--- a/server/plugin/discovery/etcd/watcher_inner.go
+++ b/server/plugin/discovery/etcd/watcher_inner.go
@@ -49,9 +49,11 @@ func (w *innerWatcher) process(_ context.Context) {
 	case <-stopCh:
 		// timed out or exception
 		w.Stop()
+		cancel()
 	case <-w.stopCh:
 		cancel()
 	}
+
 }
 
 func (w *innerWatcher) sendEvent(resp *registry.PluginResponse) {
diff --git a/server/plugin/discovery/indexer_cache.go b/server/plugin/discovery/indexer_cache.go
index 170a4e2..0b49c1f 100644
--- a/server/plugin/discovery/indexer_cache.go
+++ b/server/plugin/discovery/indexer_cache.go
@@ -72,7 +72,7 @@ func (i *CacheIndexer) searchByPrefix(op registry.PluginOp) *Response {
 	t := time.Now()
 	kvs := make([]*KeyValue, 0, resp.Count)
 	i.Cache.GetPrefix(prefix, &kvs)
-	log.LogNilOrWarnf(t, "too long to index data[%d] from cache '%s'", len(kvs), i.Cache.Name())
+	log.NilOrWarnf(t, "too long to index data[%d] from cache '%s'", len(kvs), i.Cache.Name())
 
 	resp.Kvs = kvs
 	return resp
diff --git a/server/plugin/discovery/k8s/adaptor/cacher.go b/server/plugin/discovery/k8s/adaptor/cacher.go
index 27bfd39..481c1d1 100644
--- a/server/plugin/discovery/k8s/adaptor/cacher.go
+++ b/server/plugin/discovery/k8s/adaptor/cacher.go
@@ -25,7 +25,7 @@ func BuildCacher(t discovery.Type, cfg *discovery.Config, cache discovery.Cache)
 	switch t {
 	case backend.SERVICE:
 		return NewServiceCacher(kc)
-	case backend.SERVICE_INDEX:
+	case backend.ServiceIndex:
 		return NewServiceIndexCacher(kc)
 	case backend.INSTANCE:
 		return NewInstanceCacher(kc)
diff --git a/server/plugin/discovery/k8s/adaptor/cacher_index.go b/server/plugin/discovery/k8s/adaptor/cacher_index.go
index 18f42a3..d1a2852 100644
--- a/server/plugin/discovery/k8s/adaptor/cacher_index.go
+++ b/server/plugin/discovery/k8s/adaptor/cacher_index.go
@@ -31,7 +31,7 @@ func (c *ServiceIndexCacher) onServiceEvent(evt K8sEvent) {
 	svc := evt.Object.(*v1.Service)
 	domainProject := Kubernetes().GetDomainProject()
 	indexKey := core.GenerateServiceIndexKey(generateServiceKey(domainProject, svc))
-	serviceId := generateServiceId(domainProject, svc)
+	serviceID := generateServiceID(domainProject, svc)
 
 	if !ShouldRegisterService(svc) {
 		kv := c.Cache().Get(indexKey)
@@ -43,7 +43,7 @@ func (c *ServiceIndexCacher) onServiceEvent(evt K8sEvent) {
 
 	switch evt.EventType {
 	case pb.EVT_CREATE:
-		kv := AsKeyValue(indexKey, serviceId, svc.ResourceVersion)
+		kv := AsKeyValue(indexKey, serviceID, svc.ResourceVersion)
 		c.Notify(evt.EventType, indexKey, kv)
 	case pb.EVT_UPDATE:
 	case pb.EVT_DELETE:
diff --git a/server/plugin/discovery/k8s/adaptor/cacher_instance.go b/server/plugin/discovery/k8s/adaptor/cacher_instance.go
index 71378d9..f5cf037 100644
--- a/server/plugin/discovery/k8s/adaptor/cacher_instance.go
+++ b/server/plugin/discovery/k8s/adaptor/cacher_instance.go
@@ -33,14 +33,14 @@ type InstanceCacher struct {
 func (c *InstanceCacher) onServiceEvent(evt K8sEvent) {
 	svc := evt.Object.(*v1.Service)
 	domainProject := Kubernetes().GetDomainProject()
-	serviceId := generateServiceId(domainProject, svc)
+	serviceID := generateServiceID(domainProject, svc)
 
 	switch evt.EventType {
 	case pb.EVT_DELETE:
-		c.deleteInstances(domainProject, serviceId)
+		c.deleteInstances(domainProject, serviceID)
 	case pb.EVT_UPDATE:
 		if !ShouldRegisterService(svc) {
-			c.deleteInstances(domainProject, serviceId)
+			c.deleteInstances(domainProject, serviceID)
 			return
 		}
 		ep := Kubernetes().GetEndpoints(svc.Namespace, svc.Name)
@@ -48,9 +48,9 @@ func (c *InstanceCacher) onServiceEvent(evt K8sEvent) {
 	}
 }
 
-func (c *InstanceCacher) getInstances(domainProject, serviceId string) (m map[string]*discovery.KeyValue) {
+func (c *InstanceCacher) getInstances(domainProject, serviceID string) (m map[string]*discovery.KeyValue) {
 	var arr []*discovery.KeyValue
-	key := core.GenerateInstanceKey(domainProject, serviceId, "")
+	key := core.GenerateInstanceKey(domainProject, serviceID, "")
 	if l := c.Cache().GetPrefix(key, &arr); l > 0 {
 		m = make(map[string]*discovery.KeyValue, l)
 		for _, kv := range arr {
@@ -60,9 +60,9 @@ func (c *InstanceCacher) getInstances(domainProject, serviceId string) (m map[st
 	return
 }
 
-func (c *InstanceCacher) deleteInstances(domainProject, serviceId string) {
+func (c *InstanceCacher) deleteInstances(domainProject, serviceID string) {
 	var kvs []*discovery.KeyValue
-	c.Cache().GetPrefix(core.GenerateInstanceKey(domainProject, serviceId, ""), &kvs)
+	c.Cache().GetPrefix(core.GenerateInstanceKey(domainProject, serviceID, ""), &kvs)
 	for _, kv := range kvs {
 		key := util.BytesToStringWithNoCopy(kv.Key)
 		c.Notify(pb.EVT_DELETE, key, kv)
@@ -78,9 +78,9 @@ func (c *InstanceCacher) onEndpointsEvent(evt K8sEvent) {
 	}
 
 	domainProject := Kubernetes().GetDomainProject()
-	serviceId := generateServiceId(domainProject, svc)
+	serviceID := generateServiceID(domainProject, svc)
 
-	oldKvs := c.getInstances(domainProject, serviceId)
+	oldKvs := c.getInstances(domainProject, serviceID)
 	newKvs := make(map[string]*discovery.KeyValue)
 	for _, ss := range ep.Subsets {
 		for _, ea := range ss.Addresses {
@@ -89,8 +89,8 @@ func (c *InstanceCacher) onEndpointsEvent(evt K8sEvent) {
 				continue
 			}
 
-			instanceId := UUID(pod.UID)
-			key := core.GenerateInstanceKey(Kubernetes().GetDomainProject(), serviceId, instanceId)
+			instanceID := UUID(pod.UID)
+			key := core.GenerateInstanceKey(Kubernetes().GetDomainProject(), serviceID, instanceID)
 			switch evt.EventType {
 			case pb.EVT_CREATE, pb.EVT_UPDATE:
 				if pod.Status.Phase != v1.PodRunning {
@@ -103,8 +103,8 @@ func (c *InstanceCacher) onEndpointsEvent(evt K8sEvent) {
 				}
 
 				inst := &pb.MicroServiceInstance{
-					InstanceId:     instanceId,
-					ServiceId:      serviceId,
+					InstanceId:     instanceID,
+					ServiceId:      serviceID,
 					HostName:       pod.Name,
 					Status:         pb.MSI_UP,
 					DataCenterInfo: &pb.DataCenterInfo{},
diff --git a/server/plugin/discovery/k8s/adaptor/cacher_service.go b/server/plugin/discovery/k8s/adaptor/cacher_service.go
index fdeafd1..8d0f063 100644
--- a/server/plugin/discovery/k8s/adaptor/cacher_service.go
+++ b/server/plugin/discovery/k8s/adaptor/cacher_service.go
@@ -30,8 +30,8 @@ type ServiceCacher struct {
 func (c *ServiceCacher) onServiceEvent(evt K8sEvent) {
 	svc := evt.Object.(*v1.Service)
 	domainProject := Kubernetes().GetDomainProject()
-	serviceId := generateServiceId(domainProject, svc)
-	key := core.GenerateServiceKey(domainProject, serviceId)
+	serviceID := generateServiceID(domainProject, svc)
+	key := core.GenerateServiceKey(domainProject, serviceID)
 
 	if !ShouldRegisterService(svc) {
 		kv := c.Cache().Get(key)
diff --git a/server/plugin/discovery/k8s/adaptor/common.go b/server/plugin/discovery/k8s/adaptor/common.go
index 990b8c3..ae5992a 100644
--- a/server/plugin/discovery/k8s/adaptor/common.go
+++ b/server/plugin/discovery/k8s/adaptor/common.go
@@ -106,8 +106,8 @@ func UUID(id types.UID) string {
 	return strings.Replace(string(id), "-", "", -1)
 }
 
-func generateServiceId(domainProject string, svc *v1.Service) string {
+func generateServiceID(domainProject string, svc *v1.Service) string {
 	indexKey := core.GenerateServiceIndexKey(generateServiceKey(domainProject, svc))
 	ctx := context.WithValue(context.Background(), uuid.ContextKey, indexKey)
-	return mgr.Plugins().UUID().GetServiceId(ctx)
+	return mgr.Plugins().UUID().GetServiceID(ctx)
 }
diff --git a/server/plugin/discovery/k8s/adaptor/convertor.go b/server/plugin/discovery/k8s/adaptor/convertor.go
index bc19b1e..5bec7a7 100644
--- a/server/plugin/discovery/k8s/adaptor/convertor.go
+++ b/server/plugin/discovery/k8s/adaptor/convertor.go
@@ -89,7 +89,7 @@ func generateServiceKey(domainProject string, svc *v1.Service) *pb.MicroServiceK
 
 func FromK8sService(domainProject string, svc *v1.Service) (ms *pb.MicroService) {
 	ms = &pb.MicroService{
-		ServiceId:   generateServiceId(domainProject, svc),
+		ServiceId:   generateServiceID(domainProject, svc),
 		Environment: getLabel(svc.Labels, LabelEnvironment, ""),
 		AppId:       getLabel(svc.Labels, LabelApp, pb.APP_ID),
 		ServiceName: svc.Name,
diff --git a/server/plugin/discovery/k8s/adaptor/kube_client.go b/server/plugin/discovery/k8s/adaptor/kube_client.go
index c92f73e..bad7d33 100644
--- a/server/plugin/discovery/k8s/adaptor/kube_client.go
+++ b/server/plugin/discovery/k8s/adaptor/kube_client.go
@@ -223,12 +223,17 @@ func (c *K8sClient) GetNodeByPod(pod *v1.Pod) (node *v1.Node) {
 
 func (c *K8sClient) Run() {
 	if err := c.init(); err != nil {
-		alarm.Raise(alarm.IdBackendConnectionRefuse,
+		err = alarm.Raise(alarm.IDBackendConnectionRefuse,
 			alarm.AdditionalContext("%v", err))
+		if err != nil {
+			log.Error("", err)
+		}
 		return
 	}
-	alarm.Clear(alarm.IdBackendConnectionRefuse)
-
+	err := alarm.Clear(alarm.IDBackendConnectionRefuse)
+	if err != nil {
+		log.Error("", err)
+	}
 	c.goroutine.
 		Do(func(_ context.Context) { c.services.Run(c.stopCh) }).
 		Do(func(_ context.Context) { c.endpoints.Run(c.stopCh) }).
diff --git a/server/plugin/discovery/k8s/repo.go b/server/plugin/discovery/k8s/repo.go
index 699911e..6f3b983 100644
--- a/server/plugin/discovery/k8s/repo.go
+++ b/server/plugin/discovery/k8s/repo.go
@@ -24,16 +24,16 @@ import (
 )
 
 func init() {
-	mgr.RegisterPlugin(mgr.Plugin{mgr.DISCOVERY, "k8s", NewRepository})
+	mgr.RegisterPlugin(mgr.Plugin{PName: mgr.DISCOVERY, Name: "k8s", New: NewRepository})
 }
 
-type K8sRepository struct {
+type Repository struct {
 }
 
-func (r *K8sRepository) New(t discovery.Type, cfg *discovery.Config) discovery.Adaptor {
+func (r *Repository) New(t discovery.Type, cfg *discovery.Config) discovery.Adaptor {
 	return adaptor.NewK8sAdaptor(t, cfg)
 }
 
 func NewRepository() mgr.Instance {
-	return &K8sRepository{}
+	return &Repository{}
 }
diff --git a/server/plugin/discovery/metrics.go b/server/plugin/discovery/metrics.go
index 16681e8..4cd41a2 100644
--- a/server/plugin/discovery/metrics.go
+++ b/server/plugin/discovery/metrics.go
@@ -37,7 +37,7 @@ var (
 			Subsystem:  "db",
 			Name:       "backend_event_durations_microseconds",
 			Help:       "Latency of backend events processing",
-			Objectives: prometheus.DefObjectives,
+			Objectives: metric.Pxx,
 		}, []string{"instance", "prefix"})
 )
 
diff --git a/server/plugin/discovery/servicecenter/adaptor.go b/server/plugin/discovery/servicecenter/adaptor.go
index eded1dc..5f67791 100644
--- a/server/plugin/discovery/servicecenter/adaptor.go
+++ b/server/plugin/discovery/servicecenter/adaptor.go
@@ -20,44 +20,43 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/discovery"
 )
 
-// ServiceCenterAdaptor implements discovery.Adaptor.
-// ServiceCenterAdaptor does service discovery with other service-centers
+// Adaptor implements discovery.Adaptor.
+// Adaptor does service discovery with other service-centers
 // as it's registry.
-type ServiceCenterAdaptor struct {
+type Adaptor struct {
 	discovery.Cacher
 	discovery.Indexer
 }
 
-func (se *ServiceCenterAdaptor) Run() {
+func (se *Adaptor) Run() {
 	if r, ok := se.Cacher.(discovery.Runnable); ok {
 		r.Run()
 	}
 }
 
-func (se *ServiceCenterAdaptor) Stop() {
+func (se *Adaptor) Stop() {
 	if r, ok := se.Cacher.(discovery.Runnable); ok {
 		r.Stop()
 	}
 }
 
-func (se *ServiceCenterAdaptor) Ready() <-chan struct{} {
+func (se *Adaptor) Ready() <-chan struct{} {
 	if r, ok := se.Cacher.(discovery.Runnable); ok {
 		return r.Ready()
 	}
 	return closedCh
 }
 
-func NewServiceCenterAdaptor(t discovery.Type, cfg *discovery.Config) *ServiceCenterAdaptor {
+func NewServiceCenterAdaptor(t discovery.Type, cfg *discovery.Config) *Adaptor {
 	if t == backend.SCHEMA {
-		return &ServiceCenterAdaptor{
+		return &Adaptor{
 			Indexer: NewClusterIndexer(t, discovery.NullCache),
 			Cacher:  discovery.NullCacher,
 		}
-	} else {
-		cache := discovery.NewKvCache(t.String(), cfg)
-		return &ServiceCenterAdaptor{
-			Indexer: NewClusterIndexer(t, cache),
-			Cacher:  BuildCacher(t, cfg, cache),
-		}
+	}
+	cache := discovery.NewKvCache(t.String(), cfg)
+	return &Adaptor{
+		Indexer: NewClusterIndexer(t, cache),
+		Cacher:  BuildCacher(t, cfg, cache),
 	}
 }
diff --git a/server/plugin/discovery/servicecenter/aggregate.go b/server/plugin/discovery/servicecenter/aggregate.go
index 9e5f412..55d087a 100644
--- a/server/plugin/discovery/servicecenter/aggregate.go
+++ b/server/plugin/discovery/servicecenter/aggregate.go
@@ -20,8 +20,8 @@ import (
 	"crypto/tls"
 	"github.com/apache/servicecomb-service-center/pkg/client/sc"
 	"github.com/apache/servicecomb-service-center/pkg/log"
+	"github.com/apache/servicecomb-service-center/pkg/model"
 	"github.com/apache/servicecomb-service-center/pkg/util"
-	"github.com/apache/servicecomb-service-center/server/admin/model"
 	"github.com/apache/servicecomb-service-center/server/core"
 	mgr "github.com/apache/servicecomb-service-center/server/plugin"
 	"github.com/apache/servicecomb-service-center/server/plugin/discovery"
@@ -37,7 +37,7 @@ var (
 	clientTLS  *tls.Config
 )
 
-type SCClientAggregate []*sc.SCClient
+type SCClientAggregate []*sc.Client
 
 func getClientTLS() (*tls.Config, error) {
 	if clientTLS != nil {
@@ -84,12 +84,12 @@ func (c *SCClientAggregate) cacheAppend(name string, setter model.Setter, getter
 	})
 }
 
-func (c *SCClientAggregate) GetSchemasByServiceId(ctx context.Context, domainProject, serviceId string) (*discovery.Response, *scerr.Error) {
+func (c *SCClientAggregate) GetSchemasByServiceID(ctx context.Context, domainProject, serviceID string) (*discovery.Response, *scerr.Error) {
 	var response discovery.Response
 	for _, client := range *c {
-		schemas, err := client.GetSchemasByServiceId(ctx, domainProject, serviceId)
+		schemas, err := client.GetSchemasByServiceID(ctx, domainProject, serviceID)
 		if err != nil && err.InternalError() {
-			log.Errorf(err, "get schema by serviceId[%s/%s] failed", domainProject, serviceId)
+			log.Errorf(err, "get schema by serviceID[%s/%s] failed", domainProject, serviceID)
 			continue
 		}
 		if schemas == nil {
@@ -98,7 +98,7 @@ func (c *SCClientAggregate) GetSchemasByServiceId(ctx context.Context, domainPro
 		response.Count = int64(len(schemas))
 		for _, schema := range schemas {
 			response.Kvs = append(response.Kvs, &discovery.KeyValue{
-				Key:         []byte(core.GenerateServiceSchemaKey(domainProject, serviceId, schema.SchemaId)),
+				Key:         []byte(core.GenerateServiceSchemaKey(domainProject, serviceID, schema.SchemaId)),
 				Value:       util.StringToBytesWithNoCopy(schema.Schema),
 				ModRevision: 0,
 				ClusterName: client.Cfg.Name,
@@ -109,12 +109,12 @@ func (c *SCClientAggregate) GetSchemasByServiceId(ctx context.Context, domainPro
 	return &response, nil
 }
 
-func (c *SCClientAggregate) GetSchemaBySchemaId(ctx context.Context, domainProject, serviceId, schemaId string) (*discovery.Response, *scerr.Error) {
+func (c *SCClientAggregate) GetSchemaBySchemaID(ctx context.Context, domainProject, serviceID, schemaID string) (*discovery.Response, *scerr.Error) {
 	var response discovery.Response
 	for _, client := range *c {
-		schema, err := client.GetSchemaBySchemaId(ctx, domainProject, serviceId, schemaId)
+		schema, err := client.GetSchemaBySchemaID(ctx, domainProject, serviceID, schemaID)
 		if err != nil && err.InternalError() {
-			log.Errorf(err, "get schema by serviceId[%s/%s] failed", domainProject, serviceId)
+			log.Errorf(err, "get schema by serviceID[%s/%s] failed", domainProject, serviceID)
 			continue
 		}
 		if schema == nil {
@@ -122,7 +122,7 @@ func (c *SCClientAggregate) GetSchemaBySchemaId(ctx context.Context, domainProje
 		}
 		response.Count = 1
 		response.Kvs = append(response.Kvs, &discovery.KeyValue{
-			Key:         []byte(core.GenerateServiceSchemaKey(domainProject, serviceId, schema.SchemaId)),
+			Key:         []byte(core.GenerateServiceSchemaKey(domainProject, serviceID, schema.SchemaId)),
 			Value:       util.StringToBytesWithNoCopy(schema.Schema),
 			ModRevision: 0,
 			ClusterName: client.Cfg.Name,
@@ -132,12 +132,12 @@ func (c *SCClientAggregate) GetSchemaBySchemaId(ctx context.Context, domainProje
 	return &response, nil
 }
 
-func (c *SCClientAggregate) GetInstancesByServiceId(ctx context.Context, domainProject, providerId, consumerId string) (*discovery.Response, *scerr.Error) {
+func (c *SCClientAggregate) GetInstancesByServiceID(ctx context.Context, domainProject, providerID, consumerID string) (*discovery.Response, *scerr.Error) {
 	var response discovery.Response
 	for _, client := range *c {
-		insts, err := client.GetInstancesByServiceId(ctx, domainProject, providerId, consumerId)
+		insts, err := client.GetInstancesByServiceID(ctx, domainProject, providerID, consumerID)
 		if err != nil && err.InternalError() {
-			log.Errorf(err, "consumer[%s] get provider[%s/%s] instances failed", consumerId, domainProject, providerId)
+			log.Errorf(err, "consumer[%s] get provider[%s/%s] instances failed", consumerID, domainProject, providerID)
 			continue
 		}
 		if insts == nil {
@@ -146,7 +146,7 @@ func (c *SCClientAggregate) GetInstancesByServiceId(ctx context.Context, domainP
 		response.Count = int64(len(insts))
 		for _, instance := range insts {
 			response.Kvs = append(response.Kvs, &discovery.KeyValue{
-				Key:         []byte(core.GenerateInstanceKey(domainProject, providerId, instance.InstanceId)),
+				Key:         []byte(core.GenerateInstanceKey(domainProject, providerID, instance.InstanceId)),
 				Value:       instance,
 				ModRevision: 0,
 				ClusterName: client.Cfg.Name,
@@ -156,12 +156,12 @@ func (c *SCClientAggregate) GetInstancesByServiceId(ctx context.Context, domainP
 	return &response, nil
 }
 
-func (c *SCClientAggregate) GetInstanceByInstanceId(ctx context.Context, domainProject, providerId, instanceId, consumerId string) (*discovery.Response, *scerr.Error) {
+func (c *SCClientAggregate) GetInstanceByInstanceID(ctx context.Context, domainProject, providerID, instanceID, consumerID string) (*discovery.Response, *scerr.Error) {
 	var response discovery.Response
 	for _, client := range *c {
-		instance, err := client.GetInstanceByInstanceId(ctx, domainProject, providerId, instanceId, consumerId)
+		instance, err := client.GetInstanceByInstanceID(ctx, domainProject, providerID, instanceID, consumerID)
 		if err != nil && err.InternalError() {
-			log.Errorf(err, "consumer[%s] get provider[%s/%s] instances failed", consumerId, domainProject, providerId)
+			log.Errorf(err, "consumer[%s] get provider[%s/%s] instances failed", consumerID, domainProject, providerID)
 			continue
 		}
 		if instance == nil {
@@ -169,7 +169,7 @@ func (c *SCClientAggregate) GetInstanceByInstanceId(ctx context.Context, domainP
 		}
 		response.Count = 1
 		response.Kvs = append(response.Kvs, &discovery.KeyValue{
-			Key:         []byte(core.GenerateInstanceKey(domainProject, providerId, instance.InstanceId)),
+			Key:         []byte(core.GenerateInstanceKey(domainProject, providerID, instance.InstanceId)),
 			Value:       instance,
 			ModRevision: 0,
 			ClusterName: client.Cfg.Name,
@@ -194,7 +194,7 @@ func GetOrCreateSCClient() *SCClientAggregate {
 			}
 			client.Timeout = registry.Configuration().RequestTimeOut
 			// TLS
-			if strings.Index(endpoints[0], "https") >= 0 {
+			if strings.Contains(endpoints[0], "https") {
 				client.TLS, err = getClientTLS()
 				if err != nil {
 					log.Errorf(err, "get service center[%s]%v tls config failed", name, endpoints)
diff --git a/server/plugin/discovery/servicecenter/cacher.go b/server/plugin/discovery/servicecenter/cacher.go
index 9ce955d..d0168ae 100644
--- a/server/plugin/discovery/servicecenter/cacher.go
+++ b/server/plugin/discovery/servicecenter/cacher.go
@@ -19,16 +19,16 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/discovery"
 )
 
-type ServiceCenterCacher struct {
+type Cacher struct {
 	*discovery.CommonCacher
 }
 
-func (c *ServiceCenterCacher) Ready() <-chan struct{} {
+func (c *Cacher) Ready() <-chan struct{} {
 	return closedCh
 }
 
-func NewServiceCenterCacher(cfg *discovery.Config, cache discovery.Cache) *ServiceCenterCacher {
-	return &ServiceCenterCacher{
+func NewServiceCenterCacher(cfg *discovery.Config, cache discovery.Cache) *Cacher {
+	return &Cacher{
 		CommonCacher: discovery.NewCommonCacher(cfg, cache),
 	}
 }
diff --git a/server/plugin/discovery/servicecenter/indexer.go b/server/plugin/discovery/servicecenter/indexer.go
index ea502f9..f17374b 100644
--- a/server/plugin/discovery/servicecenter/indexer.go
+++ b/server/plugin/discovery/servicecenter/indexer.go
@@ -78,11 +78,11 @@ func (i *ClusterIndexer) searchSchemas(ctx context.Context, op registry.PluginOp
 		resp  *discovery.Response
 		scErr *scerr.Error
 	)
-	domainProject, serviceId, schemaId := core.GetInfoFromSchemaKV(op.Key)
-	if op.Prefix && len(schemaId) == 0 {
-		resp, scErr = i.Client.GetSchemasByServiceId(ctx, domainProject, serviceId)
+	domainProject, serviceID, schemaID := core.GetInfoFromSchemaKV(op.Key)
+	if op.Prefix && len(schemaID) == 0 {
+		resp, scErr = i.Client.GetSchemasByServiceID(ctx, domainProject, serviceID)
 	} else {
-		resp, scErr = i.Client.GetSchemaBySchemaId(ctx, domainProject, serviceId, schemaId)
+		resp, scErr = i.Client.GetSchemaBySchemaID(ctx, domainProject, serviceID, schemaID)
 	}
 	if scErr != nil {
 		return nil, scErr
@@ -95,11 +95,11 @@ func (i *ClusterIndexer) searchInstances(ctx context.Context, op registry.Plugin
 		resp  *discovery.Response
 		scErr *scerr.Error
 	)
-	serviceId, instanceId, domainProject := core.GetInfoFromInstKV(op.Key)
-	if op.Prefix && len(instanceId) == 0 {
-		resp, scErr = i.Client.GetInstancesByServiceId(ctx, domainProject, serviceId, "")
+	serviceID, instanceID, domainProject := core.GetInfoFromInstKV(op.Key)
+	if op.Prefix && len(instanceID) == 0 {
+		resp, scErr = i.Client.GetInstancesByServiceID(ctx, domainProject, serviceID, "")
 	} else {
-		resp, scErr = i.Client.GetInstanceByInstanceId(ctx, domainProject, serviceId, instanceId, "")
+		resp, scErr = i.Client.GetInstanceByInstanceID(ctx, domainProject, serviceID, instanceID, "")
 	}
 	if scErr != nil {
 		return nil, scErr
diff --git a/server/plugin/discovery/servicecenter/repo.go b/server/plugin/discovery/servicecenter/repo.go
index c78f5db..eda22f0 100644
--- a/server/plugin/discovery/servicecenter/repo.go
+++ b/server/plugin/discovery/servicecenter/repo.go
@@ -22,19 +22,19 @@ import (
 )
 
 func init() {
-	mgr.RegisterPlugin(mgr.Plugin{mgr.DISCOVERY, "servicecenter", NewRepository})
+	mgr.RegisterPlugin(mgr.Plugin{PName: mgr.DISCOVERY, Name: "servicecenter", New: NewRepository})
 }
 
-type ServiceCenterRepository struct {
+type Repository struct {
 }
 
-func (r *ServiceCenterRepository) New(t discovery.Type, cfg *discovery.Config) discovery.Adaptor {
+func (r *Repository) New(t discovery.Type, cfg *discovery.Config) discovery.Adaptor {
 	return NewServiceCenterAdaptor(t, cfg)
 }
 
 func NewRepository() mgr.Instance {
 	InitConfigs()
-	return &ServiceCenterRepository{}
+	return &Repository{}
 }
 
 func InitConfigs() {
diff --git a/server/plugin/discovery/servicecenter/syncer.go b/server/plugin/discovery/servicecenter/syncer.go
index ee76407..3aa4b6a 100644
--- a/server/plugin/discovery/servicecenter/syncer.go
+++ b/server/plugin/discovery/servicecenter/syncer.go
@@ -17,13 +17,13 @@ package servicecenter
 
 import (
 	"fmt"
+	"github.com/apache/servicecomb-service-center/pkg/model"
 	"sync"
 	"time"
 
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
-	"github.com/apache/servicecomb-service-center/server/admin/model"
 	"github.com/apache/servicecomb-service-center/server/alarm"
 	"github.com/apache/servicecomb-service-center/server/core"
 	"github.com/apache/servicecomb-service-center/server/core/backend"
@@ -42,11 +42,11 @@ var (
 type Syncer struct {
 	Client *SCClientAggregate
 
-	cachers map[discovery.Type]*ServiceCenterCacher
+	cachers map[discovery.Type]*Cacher
 }
 
 func (c *Syncer) Initialize() {
-	c.cachers = make(map[discovery.Type]*ServiceCenterCacher)
+	c.cachers = make(map[discovery.Type]*Cacher)
 	c.Client = GetOrCreateSCClient()
 }
 
@@ -55,29 +55,34 @@ func (c *Syncer) Sync(ctx context.Context) {
 	if len(errs) > 0 {
 		err := fmt.Errorf("%v", errs)
 		log.Errorf(err, "Sync catches errors")
-		alarm.Raise(alarm.IdBackendConnectionRefuse,
+		err = alarm.Raise(alarm.IDBackendConnectionRefuse,
 			alarm.AdditionalContext(err.Error()))
+		if err != nil {
+			log.Error("", err)
+		}
 		if cache == nil {
 			return
 		}
 	}
-	alarm.Clear(alarm.IdBackendConnectionRefuse)
-
+	err := alarm.Clear(alarm.IDBackendConnectionRefuse)
+	if err != nil {
+		log.Error("", err)
+	}
 	// microservice
 	serviceCacher, ok := c.cachers[backend.SERVICE]
 	if ok {
 		c.check(serviceCacher, &cache.Microservices, errs)
 	}
-	indexCacher, ok := c.cachers[backend.SERVICE_INDEX]
+	indexCacher, ok := c.cachers[backend.ServiceIndex]
 	if ok {
 		c.checkWithConflictHandleFunc(indexCacher, &cache.Indexes, errs, c.logConflictFunc)
 	}
-	aliasCacher, ok := c.cachers[backend.SERVICE_ALIAS]
+	aliasCacher, ok := c.cachers[backend.ServiceAlias]
 	if ok {
 		c.checkWithConflictHandleFunc(aliasCacher, &cache.Aliases, errs, c.logConflictFunc)
 	}
 	// microservice meta
-	tagCacher, ok := c.cachers[backend.SERVICE_TAG]
+	tagCacher, ok := c.cachers[backend.ServiceTag]
 	if ok {
 		c.check(tagCacher, &cache.Tags, errs)
 	}
@@ -85,15 +90,15 @@ func (c *Syncer) Sync(ctx context.Context) {
 	if ok {
 		c.check(ruleCacher, &cache.Rules, errs)
 	}
-	ruleIndexCacher, ok := c.cachers[backend.RULE_INDEX]
+	ruleIndexCacher, ok := c.cachers[backend.RuleIndex]
 	if ok {
 		c.check(ruleIndexCacher, &cache.RuleIndexes, errs)
 	}
-	depRuleCacher, ok := c.cachers[backend.DEPENDENCY_RULE]
+	depRuleCacher, ok := c.cachers[backend.DependencyRule]
 	if ok {
 		c.check(depRuleCacher, &cache.DependencyRules, errs)
 	}
-	schemaSummaryCacher, ok := c.cachers[backend.SCHEMA_SUMMARY]
+	schemaSummaryCacher, ok := c.cachers[backend.SchemaSummary]
 	if ok {
 		c.check(schemaSummaryCacher, &cache.Summaries, errs)
 	}
@@ -104,11 +109,11 @@ func (c *Syncer) Sync(ctx context.Context) {
 	}
 }
 
-func (c *Syncer) check(local *ServiceCenterCacher, remote model.Getter, skipClusters map[string]error) {
+func (c *Syncer) check(local *Cacher, remote model.Getter, skipClusters map[string]error) {
 	c.checkWithConflictHandleFunc(local, remote, skipClusters, c.skipHandleFunc)
 }
 
-func (c *Syncer) checkWithConflictHandleFunc(local *ServiceCenterCacher, remote model.Getter, skipClusters map[string]error,
+func (c *Syncer) checkWithConflictHandleFunc(local *Cacher, remote model.Getter, skipClusters map[string]error,
 	conflictHandleFunc func(origin *model.KV, conflict model.Getter, index int)) {
 	exists := make(map[string]*model.KV)
 	remote.ForEach(func(i int, v *model.KV) bool {
@@ -183,20 +188,20 @@ func (c *Syncer) logConflictFunc(origin *model.KV, conflict model.Getter, index
 	case *model.MicroserviceIndexSlice:
 		slice := conflict.(*model.MicroserviceIndexSlice)
 		kv := (*slice)[index]
-		if serviceId := origin.Value.(string); kv.Value != serviceId {
+		if serviceID := origin.Value.(string); kv.Value != serviceID {
 			key := core.GetInfoFromSvcIndexKV(util.StringToBytesWithNoCopy(kv.Key))
 			log.Warnf("conflict! can not merge microservice index[%s][%s][%s/%s/%s/%s], found one[%s] in cluster[%s]",
 				kv.ClusterName, kv.Value, key.Environment, key.AppId, key.ServiceName, key.Version,
-				serviceId, origin.ClusterName)
+				serviceID, origin.ClusterName)
 		}
 	case *model.MicroserviceAliasSlice:
 		slice := conflict.(*model.MicroserviceAliasSlice)
 		kv := (*slice)[index]
-		if serviceId := origin.Value.(string); kv.Value != serviceId {
+		if serviceID := origin.Value.(string); kv.Value != serviceID {
 			key := core.GetInfoFromSvcAliasKV(util.StringToBytesWithNoCopy(kv.Key))
 			log.Warnf("conflict! can not merge microservice alias[%s][%s][%s/%s/%s/%s], found one[%s] in cluster[%s]",
 				kv.ClusterName, kv.Value, key.Environment, key.AppId, key.ServiceName, key.Version,
-				serviceId, origin.ClusterName)
+				serviceID, origin.ClusterName)
 		}
 	}
 }
@@ -226,7 +231,7 @@ func (c *Syncer) loop(ctx context.Context) {
 }
 
 // unsafe
-func (c *Syncer) AddCacher(t discovery.Type, cacher *ServiceCenterCacher) {
+func (c *Syncer) AddCacher(t discovery.Type, cacher *Cacher) {
 	c.cachers[t] = cacher
 }
 
diff --git a/server/plugin/discovery/servicecenter/syncer_test.go b/server/plugin/discovery/servicecenter/syncer_test.go
index 4667162..27c345f 100644
--- a/server/plugin/discovery/servicecenter/syncer_test.go
+++ b/server/plugin/discovery/servicecenter/syncer_test.go
@@ -18,7 +18,7 @@ package servicecenter
 import (
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/log"
-	"github.com/apache/servicecomb-service-center/server/admin/model"
+	model2 "github.com/apache/servicecomb-service-center/pkg/model"
 	"github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/apache/servicecomb-service-center/server/plugin/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/registry"
@@ -30,13 +30,13 @@ func TestClusterIndexer_Sync(t *testing.T) {
 	cache := discovery.NewKvCache("test", discovery.Configure())
 	cfg := discovery.Configure()
 	sccacher := NewServiceCenterCacher(cfg, cache)
-	arr := model.MicroserviceIndexSlice{}
+	arr := model2.MicroserviceIndexSlice{}
 
 	// case: sync empty data
 	cfg.WithEventFunc(func(discovery.KvEvent) {
 		t.Fatalf("TestClusterIndexer_Sync failed")
 	})
-	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, func(*model.KV, model.Getter, int) {
+	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, func(*model2.KV, model2.Getter, int) {
 		t.Fatalf("TestClusterIndexer_Sync failed")
 	})
 
@@ -47,9 +47,9 @@ func TestClusterIndexer_Sync(t *testing.T) {
 		}
 		fmt.Println(evt)
 	})
-	arr = model.MicroserviceIndexSlice{}
-	arr.SetValue(&model.KV{Key: "/a", Value: "a", Rev: 1, ClusterName: "a"})
-	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, func(*model.KV, model.Getter, int) {
+	arr = model2.MicroserviceIndexSlice{}
+	arr.SetValue(&model2.KV{Key: "/a", Value: "a", Rev: 1, ClusterName: "a"})
+	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, func(*model2.KV, model2.Getter, int) {
 		t.Fatalf("TestClusterIndexer_Sync failed")
 	})
 
@@ -60,9 +60,9 @@ func TestClusterIndexer_Sync(t *testing.T) {
 		}
 		fmt.Println(evt)
 	})
-	arr = model.MicroserviceIndexSlice{}
-	arr.SetValue(&model.KV{Key: "/a", Value: "aa", Rev: 2, ClusterName: "a"})
-	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, func(kv *model.KV, _ model.Getter, _ int) {
+	arr = model2.MicroserviceIndexSlice{}
+	arr.SetValue(&model2.KV{Key: "/a", Value: "aa", Rev: 2, ClusterName: "a"})
+	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, func(kv *model2.KV, _ model2.Getter, _ int) {
 		t.Fatalf("TestClusterIndexer_Sync failed %v", kv)
 	})
 
@@ -70,7 +70,7 @@ func TestClusterIndexer_Sync(t *testing.T) {
 	cfg.WithEventFunc(func(evt discovery.KvEvent) {
 		t.Fatalf("TestClusterIndexer_Sync failed, %v", evt)
 	})
-	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, func(*model.KV, model.Getter, int) {
+	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, func(*model2.KV, model2.Getter, int) {
 		t.Fatalf("TestClusterIndexer_Sync failed")
 	})
 
@@ -78,9 +78,9 @@ func TestClusterIndexer_Sync(t *testing.T) {
 	cfg.WithEventFunc(func(evt discovery.KvEvent) {
 		t.Fatalf("TestClusterIndexer_Sync failed, %v", evt)
 	})
-	arr = model.MicroserviceIndexSlice{}
-	arr.SetValue(&model.KV{Key: "/a", Value: "aa", Rev: 2, ClusterName: "a"})
-	arr.SetValue(&model.KV{Key: "/a", Value: "aa", Rev: 2, ClusterName: "b"})
+	arr = model2.MicroserviceIndexSlice{}
+	arr.SetValue(&model2.KV{Key: "/a", Value: "aa", Rev: 2, ClusterName: "a"})
+	arr.SetValue(&model2.KV{Key: "/a", Value: "aa", Rev: 2, ClusterName: "b"})
 	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, syncer.logConflictFunc)
 
 	// case: conflict and print log
@@ -89,9 +89,9 @@ func TestClusterIndexer_Sync(t *testing.T) {
 		cfg.WithEventFunc(func(evt discovery.KvEvent) {
 			t.Fatalf("TestClusterIndexer_Sync failed, %v", evt)
 		})
-		arr = model.MicroserviceIndexSlice{}
-		arr.SetValue(&model.KV{Key: "/a", Value: "aa", Rev: 2, ClusterName: "a"})
-		arr.SetValue(&model.KV{Key: "/a", Value: "ab", Rev: 2, ClusterName: "b"})
+		arr = model2.MicroserviceIndexSlice{}
+		arr.SetValue(&model2.KV{Key: "/a", Value: "aa", Rev: 2, ClusterName: "a"})
+		arr.SetValue(&model2.KV{Key: "/a", Value: "ab", Rev: 2, ClusterName: "b"})
 		syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, syncer.logConflictFunc)
 		// '/a' is incorrect key and logConflictFunc will be excepted to panic here
 		t.Fatalf("TestClusterIndexer_Sync failed")
@@ -101,9 +101,9 @@ func TestClusterIndexer_Sync(t *testing.T) {
 	cfg.WithEventFunc(func(evt discovery.KvEvent) {
 		t.Fatalf("TestClusterIndexer_Sync failed, %v", evt)
 	})
-	arr = model.MicroserviceIndexSlice{}
-	arr.SetValue(&model.KV{Key: "/a", Value: "ab", Rev: 3, ClusterName: "b"})
-	syncer.checkWithConflictHandleFunc(sccacher, &arr, map[string]error{"a": fmt.Errorf("error")}, func(kv *model.KV, _ model.Getter, _ int) {
+	arr = model2.MicroserviceIndexSlice{}
+	arr.SetValue(&model2.KV{Key: "/a", Value: "ab", Rev: 3, ClusterName: "b"})
+	syncer.checkWithConflictHandleFunc(sccacher, &arr, map[string]error{"a": fmt.Errorf("error")}, func(kv *model2.KV, _ model2.Getter, _ int) {
 		t.Fatalf("TestClusterIndexer_Sync failed %v", kv)
 	})
 
@@ -111,8 +111,8 @@ func TestClusterIndexer_Sync(t *testing.T) {
 	cfg.WithEventFunc(func(evt discovery.KvEvent) {
 		t.Fatalf("TestClusterIndexer_Sync failed, %v", evt)
 	})
-	arr = model.MicroserviceIndexSlice{}
-	syncer.checkWithConflictHandleFunc(sccacher, &arr, map[string]error{"a": fmt.Errorf("error")}, func(kv *model.KV, _ model.Getter, _ int) {
+	arr = model2.MicroserviceIndexSlice{}
+	syncer.checkWithConflictHandleFunc(sccacher, &arr, map[string]error{"a": fmt.Errorf("error")}, func(kv *model2.KV, _ model2.Getter, _ int) {
 		t.Fatalf("TestClusterIndexer_Sync failed %v", kv)
 	})
 
@@ -123,8 +123,8 @@ func TestClusterIndexer_Sync(t *testing.T) {
 			t.Fatalf("TestClusterIndexer_Sync failed, %v", evt)
 		}
 	})
-	arr = model.MicroserviceIndexSlice{}
-	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, func(kv *model.KV, _ model.Getter, _ int) {
+	arr = model2.MicroserviceIndexSlice{}
+	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, func(kv *model2.KV, _ model2.Getter, _ int) {
 		t.Fatalf("TestClusterIndexer_Sync failed %v", kv)
 	})
 
@@ -135,9 +135,9 @@ func TestClusterIndexer_Sync(t *testing.T) {
 		}
 		fmt.Println(evt)
 	})
-	arr = model.MicroserviceIndexSlice{}
-	arr.SetValue(&model.KV{Key: "/a", Value: "a", Rev: 1, ClusterName: registry.Configuration().ClusterName})
-	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, func(*model.KV, model.Getter, int) {
+	arr = model2.MicroserviceIndexSlice{}
+	arr.SetValue(&model2.KV{Key: "/a", Value: "a", Rev: 1, ClusterName: registry.Configuration().ClusterName})
+	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, func(*model2.KV, model2.Getter, int) {
 		t.Fatalf("TestClusterIndexer_Sync failed")
 	})
 
@@ -148,10 +148,10 @@ func TestClusterIndexer_Sync(t *testing.T) {
 		}
 		fmt.Println(evt)
 	})
-	arr = model.MicroserviceIndexSlice{}
-	arr.SetValue(&model.KV{Key: "/a", Value: "x", Rev: 2, ClusterName: registry.Configuration().ClusterName})
-	arr.SetValue(&model.KV{Key: "/a", Value: "aa", Rev: 2, ClusterName: "a"})
-	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, func(kv *model.KV, _ model.Getter, _ int) {
+	arr = model2.MicroserviceIndexSlice{}
+	arr.SetValue(&model2.KV{Key: "/a", Value: "x", Rev: 2, ClusterName: registry.Configuration().ClusterName})
+	arr.SetValue(&model2.KV{Key: "/a", Value: "aa", Rev: 2, ClusterName: "a"})
+	syncer.checkWithConflictHandleFunc(sccacher, &arr, nil, func(kv *model2.KV, _ model2.Getter, _ int) {
 		t.Fatalf("TestClusterIndexer_Sync failed %v", kv)
 	})
 }
diff --git a/server/plugin/discovery/types.go b/server/plugin/discovery/types.go
index d3f2cde..b341cae 100644
--- a/server/plugin/discovery/types.go
+++ b/server/plugin/discovery/types.go
@@ -47,14 +47,14 @@ func (st Type) String() string {
 	return "TYPE" + strconv.Itoa(int(st))
 }
 
-func RegisterType(name string) (newId Type, err error) {
+func RegisterType(name string) (newID Type, err error) {
 	for _, n := range Types {
 		if n.String() == name {
 			return TypeError, fmt.Errorf("redeclare store type '%s'", n)
 		}
 	}
-	newId = Type(len(Types))
-	Types = append(Types, newId)
+	newID = Type(len(Types))
+	Types = append(Types, newID)
 	typeNames = append(typeNames, name)
 	return
 }
diff --git a/server/plugin/export.go b/server/plugin/export.go
index 8e0831e..8e40c40 100644
--- a/server/plugin/export.go
+++ b/server/plugin/export.go
@@ -29,7 +29,7 @@ import (
 
 const (
 	UUID Name = iota
-	AUDIT_LOG
+	AuditLog
 	AUTH
 	CIPHER
 	QUOTA
@@ -42,7 +42,7 @@ const (
 
 var pluginNames = map[Name]string{
 	UUID:      "uuid",
-	AUDIT_LOG: "auditlog",
+	AuditLog:  "auditlog",
 	AUTH:      "auth",
 	CIPHER:    "cipher",
 	QUOTA:     "quota",
@@ -60,10 +60,10 @@ func (pm *Manager) Registry() registry.Registry {
 }
 func (pm *Manager) UUID() uuid.UUID { return pm.Instance(UUID).(uuid.UUID) }
 func (pm *Manager) AuditLog() auditlog.AuditLogger {
-	return pm.Instance(AUDIT_LOG).(auditlog.AuditLogger)
+	return pm.Instance(AuditLog).(auditlog.AuditLogger)
 }
 func (pm *Manager) Auth() auth.Auth              { return pm.Instance(AUTH).(auth.Auth) }
 func (pm *Manager) Cipher() security.Cipher      { return pm.Instance(CIPHER).(security.Cipher) }
-func (pm *Manager) Quota() quota.QuotaManager    { return pm.Instance(QUOTA).(quota.QuotaManager) }
+func (pm *Manager) Quota() quota.Manager         { return pm.Instance(QUOTA).(quota.Manager) }
 func (pm *Manager) Tracing() (v tracing.Tracing) { return pm.Instance(TRACING).(tracing.Tracing) }
 func (pm *Manager) TLS() tls.TLS                 { return pm.Instance(TLS).(tls.TLS) }
diff --git a/server/plugin/plugin.go b/server/plugin/plugin.go
index f7d28dc..783196f 100644
--- a/server/plugin/plugin.go
+++ b/server/plugin/plugin.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package plugin
 
 import (
@@ -171,7 +172,7 @@ func (pm *Manager) existDynamicPlugin(pn Name) *Plugin {
 		return nil
 	}
 	// 'buildin' implement of all plugins should call DynamicPluginFunc()
-	if plugin.PluginLoader().Exist(pn.String()) {
+	if plugin.GetLoader().Exist(pn.String()) {
 		return m[BUILDIN]
 	}
 	return nil
diff --git a/server/plugin/quota/buildin/buildin.go b/server/plugin/quota/buildin/buildin.go
index e7ddea8..63194fc 100644
--- a/server/plugin/quota/buildin/buildin.go
+++ b/server/plugin/quota/buildin/buildin.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package buildin
 
 import (
@@ -25,7 +26,7 @@ import (
 )
 
 func init() {
-	mgr.RegisterPlugin(mgr.Plugin{mgr.QUOTA, "buildin", New})
+	mgr.RegisterPlugin(mgr.Plugin{PName: mgr.QUOTA, Name: "buildin", New: New})
 	counter.RegisterCounterListener("buildin")
 }
 
@@ -34,14 +35,14 @@ func New() mgr.Instance {
 	log.Infof("quota init, service: %d, instance: %d, schema: %d/service, tag: %d/service, rule: %d/service",
 		quota.DefaultServiceQuota, quota.DefaultInstanceQuota,
 		quota.DefaultSchemaQuota, quota.DefaultTagQuota, quota.DefaultRuleQuota)
-	return &BuildInQuota{}
+	return &Quota{}
 }
 
-type BuildInQuota struct {
+type Quota struct {
 }
 
 //申请配额sourceType serviceinstance servicetype
-func (q *BuildInQuota) Apply4Quotas(ctx context.Context, res *quota.ApplyQuotaResource) *quota.ApplyQuotaResult {
+func (q *Quota) Apply4Quotas(ctx context.Context, res *quota.ApplyQuotaResource) *quota.ApplyQuotaResult {
 	df, ok := mgr.DynamicPluginFunc(mgr.QUOTA, "Apply4Quotas").(func(context.Context, *quota.ApplyQuotaResource) *quota.ApplyQuotaResult)
 	if ok {
 		return df(ctx, res)
@@ -51,7 +52,7 @@ func (q *BuildInQuota) Apply4Quotas(ctx context.Context, res *quota.ApplyQuotaRe
 }
 
 //向配额中心上报配额使用量
-func (q *BuildInQuota) RemandQuotas(ctx context.Context, quotaType quota.ResourceType) {
+func (q *Quota) RemandQuotas(ctx context.Context, quotaType quota.ResourceType) {
 	df, ok := mgr.DynamicPluginFunc(mgr.QUOTA, "RemandQuotas").(func(context.Context, quota.ResourceType))
 	if ok {
 		df(ctx, quotaType)
diff --git a/server/plugin/quota/buildin/common.go b/server/plugin/quota/buildin/common.go
index 60cdea1..38dfe79 100644
--- a/server/plugin/quota/buildin/common.go
+++ b/server/plugin/quota/buildin/common.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package buildin
 
 import (
@@ -81,7 +82,7 @@ func resourceLimitHandler(ctx context.Context, res *quota.ApplyQuotaResource) (i
 	var indexer discovery.Indexer
 
 	domainProject := res.DomainProject
-	serviceId := res.ServiceId
+	serviceID := res.ServiceID
 
 	switch res.QuotaType {
 	case quota.MicroServiceInstanceQuotaType:
@@ -89,13 +90,13 @@ func resourceLimitHandler(ctx context.Context, res *quota.ApplyQuotaResource) (i
 	case quota.MicroServiceQuotaType:
 		return globalCounter.ServiceCount, nil
 	case quota.RuleQuotaType:
-		key = core.GenerateServiceRuleKey(domainProject, serviceId, "")
+		key = core.GenerateServiceRuleKey(domainProject, serviceID, "")
 		indexer = backend.Store().Rule()
 	case quota.SchemaQuotaType:
-		key = core.GenerateServiceSchemaKey(domainProject, serviceId, "")
+		key = core.GenerateServiceSchemaKey(domainProject, serviceID, "")
 		indexer = backend.Store().Schema()
 	case quota.TagQuotaType:
-		tags, err := serviceUtil.GetTagsUtils(ctx, domainProject, serviceId)
+		tags, err := serviceUtil.GetTagsUtils(ctx, domainProject, serviceID)
 		if err != nil {
 			return 0, err
 		}
diff --git a/server/plugin/quota/buildin/counter.go b/server/plugin/quota/buildin/counter.go
index c0d0947..9f406ac 100644
--- a/server/plugin/quota/buildin/counter.go
+++ b/server/plugin/quota/buildin/counter.go
@@ -34,7 +34,7 @@ type GlobalCounter struct {
 
 func (c *GlobalCounter) OnCreate(t discovery.Type, domainProject string) {
 	switch t {
-	case backend.SERVICE_INDEX:
+	case backend.ServiceIndex:
 		c.ServiceCount++
 	case backend.INSTANCE:
 		c.InstanceCount++
@@ -43,7 +43,7 @@ func (c *GlobalCounter) OnCreate(t discovery.Type, domainProject string) {
 
 func (c *GlobalCounter) OnDelete(t discovery.Type, domainProject string) {
 	switch t {
-	case backend.SERVICE_INDEX:
+	case backend.ServiceIndex:
 		if c.ServiceCount == 0 {
 			return
 		}
diff --git a/server/plugin/quota/buildin/counter_test.go b/server/plugin/quota/buildin/counter_test.go
index a8591cf..149bc89 100644
--- a/server/plugin/quota/buildin/counter_test.go
+++ b/server/plugin/quota/buildin/counter_test.go
@@ -23,9 +23,9 @@ import (
 func TestGlobalCounter_OnCreate(t *testing.T) {
 	var counter GlobalCounter
 	counter.OnCreate(backend.SERVICE, "a/b")
-	counter.OnCreate(backend.SERVICE_INDEX, "a/b")
+	counter.OnCreate(backend.ServiceIndex, "a/b")
 	counter.OnCreate(backend.INSTANCE, "a/b")
-	counter.OnCreate(backend.SERVICE_INDEX, "a/b")
+	counter.OnCreate(backend.ServiceIndex, "a/b")
 	counter.OnCreate(backend.INSTANCE, "a/b")
 	if counter.ServiceCount != 2 || counter.InstanceCount != 2 {
 		t.Fatal("TestGlobalCounter_OnCreate failed", counter)
@@ -35,14 +35,14 @@ func TestGlobalCounter_OnCreate(t *testing.T) {
 func TestGlobalCounter_OnDelete(t *testing.T) {
 	var counter GlobalCounter
 	counter.OnDelete(backend.SERVICE, "a/b")
-	counter.OnDelete(backend.SERVICE_INDEX, "a/b")
+	counter.OnDelete(backend.ServiceIndex, "a/b")
 	counter.OnDelete(backend.INSTANCE, "a/b")
 	if counter.ServiceCount != 0 || counter.InstanceCount != 0 {
 		t.Fatal("TestGlobalCounter_OnDelete failed", counter)
 	}
-	counter.OnCreate(backend.SERVICE_INDEX, "a/b")
+	counter.OnCreate(backend.ServiceIndex, "a/b")
 	counter.OnCreate(backend.INSTANCE, "a/b")
-	counter.OnDelete(backend.SERVICE_INDEX, "a/b")
+	counter.OnDelete(backend.ServiceIndex, "a/b")
 	counter.OnDelete(backend.INSTANCE, "a/b")
 	if counter.ServiceCount != 0 || counter.InstanceCount != 0 {
 		t.Fatal("TestGlobalCounter_OnDelete failed", counter)
diff --git a/server/plugin/quota/counter/event.go b/server/plugin/quota/counter/event.go
index 948c10e..e312543 100644
--- a/server/plugin/quota/counter/event.go
+++ b/server/plugin/quota/counter/event.go
@@ -37,7 +37,7 @@ type ServiceIndexEventHandler struct {
 }
 
 func (h *ServiceIndexEventHandler) Type() discovery.Type {
-	return backend.SERVICE_INDEX
+	return backend.ServiceIndex
 }
 
 func (h *ServiceIndexEventHandler) OnEvent(evt discovery.KvEvent) {
@@ -71,16 +71,16 @@ func (h *InstanceEventHandler) Type() discovery.Type {
 }
 
 func (h *InstanceEventHandler) OnEvent(evt discovery.KvEvent) {
-	serviceId, _, domainProject := core.GetInfoFromInstKV(evt.KV.Key)
-	key := domainProject + core.SPLIT + serviceId
+	serviceID, _, domainProject := core.GetInfoFromInstKV(evt.KV.Key)
+	key := domainProject + core.SPLIT + serviceID
 	if _, ok := SharedServiceIds.Get(key); ok {
 		return
 	}
 
 	switch evt.Type {
 	case pb.EVT_INIT, pb.EVT_CREATE:
-		if domainProject == core.REGISTRY_DOMAIN_PROJECT {
-			service, err := serviceUtil.GetService(context.Background(), domainProject, serviceId)
+		if domainProject == core.RegistryDomainProject {
+			service, err := serviceUtil.GetService(context.Background(), domainProject, serviceID)
 			if service == nil || err != nil {
 				log.Errorf(err, "GetService[%s] failed", key)
 				return
diff --git a/server/plugin/quota/counter/event_test.go b/server/plugin/quota/counter/event_test.go
index fd371d9..9a171ff 100644
--- a/server/plugin/quota/counter/event_test.go
+++ b/server/plugin/quota/counter/event_test.go
@@ -30,7 +30,7 @@ type mockCounter struct {
 
 func (c *mockCounter) OnCreate(t discovery.Type, domainProject string) {
 	switch t {
-	case backend.SERVICE_INDEX:
+	case backend.ServiceIndex:
 		c.ServiceCount++
 	case backend.INSTANCE:
 		c.InstanceCount++
@@ -41,7 +41,7 @@ func (c *mockCounter) OnCreate(t discovery.Type, domainProject string) {
 
 func (c *mockCounter) OnDelete(t discovery.Type, domainProject string) {
 	switch t {
-	case backend.SERVICE_INDEX:
+	case backend.ServiceIndex:
 		c.ServiceCount--
 	case backend.INSTANCE:
 		c.InstanceCount--
@@ -61,10 +61,10 @@ func TestNewServiceIndexEventHandler(t *testing.T) {
 			Type: proto.EVT_INIT,
 			KV: &discovery.KeyValue{
 				Key: []byte(core.GenerateServiceIndexKey(&proto.MicroServiceKey{
-					Tenant:      core.REGISTRY_DOMAIN_PROJECT,
+					Tenant:      core.RegistryDomainProject,
 					Project:     "",
-					AppId:       core.REGISTRY_APP_ID,
-					ServiceName: core.REGISTRY_SERVICE_NAME,
+					AppId:       core.RegistryAppID,
+					ServiceName: core.RegistryServiceName,
 					Version:     "e",
 					Environment: "f",
 					Alias:       "g",
@@ -76,10 +76,10 @@ func TestNewServiceIndexEventHandler(t *testing.T) {
 			Type: proto.EVT_UPDATE,
 			KV: &discovery.KeyValue{
 				Key: []byte(core.GenerateServiceIndexKey(&proto.MicroServiceKey{
-					Tenant:      core.REGISTRY_DOMAIN_PROJECT,
+					Tenant:      core.RegistryDomainProject,
 					Project:     "",
-					AppId:       core.REGISTRY_APP_ID,
-					ServiceName: core.REGISTRY_SERVICE_NAME,
+					AppId:       core.RegistryAppID,
+					ServiceName: core.RegistryServiceName,
 					Version:     "e",
 					Environment: "f",
 					Alias:       "g",
@@ -91,10 +91,10 @@ func TestNewServiceIndexEventHandler(t *testing.T) {
 			Type: proto.EVT_DELETE,
 			KV: &discovery.KeyValue{
 				Key: []byte(core.GenerateServiceIndexKey(&proto.MicroServiceKey{
-					Tenant:      core.REGISTRY_DOMAIN_PROJECT,
+					Tenant:      core.RegistryDomainProject,
 					Project:     "",
-					AppId:       core.REGISTRY_APP_ID,
-					ServiceName: core.REGISTRY_SERVICE_NAME,
+					AppId:       core.RegistryAppID,
+					ServiceName: core.RegistryServiceName,
 					Version:     "e",
 					Environment: "f",
 					Alias:       "g",
@@ -106,10 +106,10 @@ func TestNewServiceIndexEventHandler(t *testing.T) {
 			Type: proto.EVT_CREATE,
 			KV: &discovery.KeyValue{
 				Key: []byte(core.GenerateServiceIndexKey(&proto.MicroServiceKey{
-					Tenant:      core.REGISTRY_DOMAIN_PROJECT,
+					Tenant:      core.RegistryDomainProject,
 					Project:     "",
-					AppId:       core.REGISTRY_APP_ID,
-					ServiceName: core.REGISTRY_SERVICE_NAME,
+					AppId:       core.RegistryAppID,
+					ServiceName: core.RegistryServiceName,
 					Version:     "e",
 					Environment: "f",
 					Alias:       "g",
@@ -191,33 +191,33 @@ func TestNewInstanceEventHandler(t *testing.T) {
 	var counter = mockCounter{}
 	RegisterCounter(&counter)
 	h := NewInstanceEventHandler()
-	SharedServiceIds.Put(core.REGISTRY_DOMAIN_PROJECT+core.SPLIT+"2", struct{}{})
+	SharedServiceIds.Put(core.RegistryDomainProject+core.SPLIT+"2", struct{}{})
 	cases := []discovery.KvEvent{
 		{
 			Type: proto.EVT_INIT,
 			KV: &discovery.KeyValue{
-				Key:   []byte(core.GenerateInstanceKey(core.REGISTRY_DOMAIN_PROJECT, "2", "1")),
+				Key:   []byte(core.GenerateInstanceKey(core.RegistryDomainProject, "2", "1")),
 				Value: nil,
 			},
 		},
 		{
 			Type: proto.EVT_UPDATE,
 			KV: &discovery.KeyValue{
-				Key:   []byte(core.GenerateInstanceKey(core.REGISTRY_DOMAIN_PROJECT, "2", "1")),
+				Key:   []byte(core.GenerateInstanceKey(core.RegistryDomainProject, "2", "1")),
 				Value: nil,
 			},
 		},
 		{
 			Type: proto.EVT_CREATE,
 			KV: &discovery.KeyValue{
-				Key:   []byte(core.GenerateInstanceKey(core.REGISTRY_DOMAIN_PROJECT, "2", "1")),
+				Key:   []byte(core.GenerateInstanceKey(core.RegistryDomainProject, "2", "1")),
 				Value: nil,
 			},
 		},
 		{
 			Type: proto.EVT_DELETE,
 			KV: &discovery.KeyValue{
-				Key:   []byte(core.GenerateInstanceKey(core.REGISTRY_DOMAIN_PROJECT, "2", "1")),
+				Key:   []byte(core.GenerateInstanceKey(core.RegistryDomainProject, "2", "1")),
 				Value: nil,
 			},
 		},
diff --git a/server/plugin/quota/quota.go b/server/plugin/quota/quota.go
index caf5442..5642c15 100644
--- a/server/plugin/quota/quota.go
+++ b/server/plugin/quota/quota.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package quota
 
 import (
@@ -37,7 +38,6 @@ const (
 	TagQuotaType
 	MicroServiceQuotaType
 	MicroServiceInstanceQuotaType
-	typeEnd
 )
 
 var (
@@ -51,7 +51,7 @@ var (
 type ApplyQuotaResult struct {
 	Err *scerr.Error
 
-	reporter QuotaReporter
+	reporter Reporter
 }
 
 func (r *ApplyQuotaResult) ReportUsedQuota(ctx context.Context) error {
@@ -68,7 +68,7 @@ func (r *ApplyQuotaResult) Close(ctx context.Context) {
 	r.reporter.Close(ctx)
 }
 
-func NewApplyQuotaResult(reporter QuotaReporter, err *scerr.Error) *ApplyQuotaResult {
+func NewApplyQuotaResult(reporter Reporter, err *scerr.Error) *ApplyQuotaResult {
 	return &ApplyQuotaResult{
 		reporter: reporter,
 		Err:      err,
@@ -78,25 +78,25 @@ func NewApplyQuotaResult(reporter QuotaReporter, err *scerr.Error) *ApplyQuotaRe
 type ApplyQuotaResource struct {
 	QuotaType     ResourceType
 	DomainProject string
-	ServiceId     string
+	ServiceID     string
 	QuotaSize     int64
 }
 
-func NewApplyQuotaResource(quotaType ResourceType, domainProject, serviceId string, quotaSize int64) *ApplyQuotaResource {
+func NewApplyQuotaResource(quotaType ResourceType, domainProject, serviceID string, quotaSize int64) *ApplyQuotaResource {
 	return &ApplyQuotaResource{
 		quotaType,
 		domainProject,
-		serviceId,
+		serviceID,
 		quotaSize,
 	}
 }
 
-type QuotaManager interface {
+type Manager interface {
 	Apply4Quotas(ctx context.Context, res *ApplyQuotaResource) *ApplyQuotaResult
 	RemandQuotas(ctx context.Context, quotaType ResourceType)
 }
 
-type QuotaReporter interface {
+type Reporter interface {
 	ReportUsedQuota(ctx context.Context) error
 	Close(ctx context.Context)
 }
diff --git a/server/plugin/quota/unlimit/unlimit.go b/server/plugin/quota/unlimit/unlimit.go
index 2d4cad7..79f41b6 100644
--- a/server/plugin/quota/unlimit/unlimit.go
+++ b/server/plugin/quota/unlimit/unlimit.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package unlimit
 
 import (
@@ -25,7 +26,7 @@ import (
 )
 
 func init() {
-	mgr.RegisterPlugin(mgr.Plugin{mgr.QUOTA, "unlimit", New})
+	mgr.RegisterPlugin(mgr.Plugin{PName: mgr.QUOTA, Name: "unlimit", New: New})
 
 	quataType := beego.AppConfig.DefaultString("quota_plugin", "")
 	if quataType != "unlimit" {
diff --git a/server/plugin/registry/buildin/buildin.go b/server/plugin/registry/buildin/buildin.go
index 43a5c13..989201f 100644
--- a/server/plugin/registry/buildin/buildin.go
+++ b/server/plugin/registry/buildin/buildin.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package buildin
 
 import (
@@ -29,51 +30,51 @@ var (
 
 func init() {
 	close(closeCh)
-	mgr.RegisterPlugin(mgr.Plugin{mgr.REGISTRY, "buildin", NewRegistry})
+	mgr.RegisterPlugin(mgr.Plugin{PName: mgr.REGISTRY, Name: "buildin", New: NewRegistry})
 }
 
-type BuildinRegistry struct {
+type Registry struct {
 	ready chan int
 }
 
-func (ec *BuildinRegistry) Err() (err <-chan error) {
+func (ec *Registry) Err() (err <-chan error) {
 	return
 }
-func (ec *BuildinRegistry) Ready() <-chan struct{} {
+func (ec *Registry) Ready() <-chan struct{} {
 	return closeCh
 }
-func (ec *BuildinRegistry) PutNoOverride(ctx context.Context, opts ...registry.PluginOpOption) (bool, error) {
+func (ec *Registry) PutNoOverride(ctx context.Context, opts ...registry.PluginOpOption) (bool, error) {
 	return false, nil
 }
-func (ec *BuildinRegistry) Do(ctx context.Context, opts ...registry.PluginOpOption) (*registry.PluginResponse, error) {
+func (ec *Registry) Do(ctx context.Context, opts ...registry.PluginOpOption) (*registry.PluginResponse, error) {
 	return noResponse, nil
 }
-func (ec *BuildinRegistry) Txn(ctx context.Context, ops []registry.PluginOp) (*registry.PluginResponse, error) {
+func (ec *Registry) Txn(ctx context.Context, ops []registry.PluginOp) (*registry.PluginResponse, error) {
 	return noResponse, nil
 }
-func (ec *BuildinRegistry) TxnWithCmp(ctx context.Context, success []registry.PluginOp, cmp []registry.CompareOp, fail []registry.PluginOp) (*registry.PluginResponse, error) {
+func (ec *Registry) TxnWithCmp(ctx context.Context, success []registry.PluginOp, cmp []registry.CompareOp, fail []registry.PluginOp) (*registry.PluginResponse, error) {
 	return noResponse, nil
 }
-func (ec *BuildinRegistry) LeaseGrant(ctx context.Context, TTL int64) (leaseID int64, err error) {
+func (ec *Registry) LeaseGrant(ctx context.Context, TTL int64) (leaseID int64, err error) {
 	return 0, nil
 }
-func (ec *BuildinRegistry) LeaseRenew(ctx context.Context, leaseID int64) (TTL int64, err error) {
+func (ec *Registry) LeaseRenew(ctx context.Context, leaseID int64) (TTL int64, err error) {
 	return 0, nil
 }
-func (ec *BuildinRegistry) LeaseRevoke(ctx context.Context, leaseID int64) error {
+func (ec *Registry) LeaseRevoke(ctx context.Context, leaseID int64) error {
 	return nil
 }
-func (ec *BuildinRegistry) Watch(ctx context.Context, opts ...registry.PluginOpOption) error {
+func (ec *Registry) Watch(ctx context.Context, opts ...registry.PluginOpOption) error {
 	return nil
 }
-func (ec *BuildinRegistry) Compact(ctx context.Context, reserve int64) error {
+func (ec *Registry) Compact(ctx context.Context, reserve int64) error {
 	return nil
 }
-func (ec *BuildinRegistry) Close() {
+func (ec *Registry) Close() {
 }
 
 func NewRegistry() mgr.Instance {
-	return &BuildinRegistry{
+	return &Registry{
 		ready: make(chan int),
 	}
 }
diff --git a/server/plugin/registry/common.go b/server/plugin/registry/common.go
index 2fa4cbc..410be24 100644
--- a/server/plugin/registry/common.go
+++ b/server/plugin/registry/common.go
@@ -27,34 +27,34 @@ const (
 )
 
 const (
-	SORT_NONE SortOrder = iota
-	SORT_ASCEND
-	SORT_DESCEND
+	SortNone SortOrder = iota
+	SortAscend
+	SortDescend
 )
 
 const (
-	CMP_VERSION CompareType = iota
-	CMP_CREATE
-	CMP_MOD
-	CMP_VALUE
+	CmpVersion CompareType = iota
+	CmpCreate
+	CmpMod
+	CmpValue
 )
 
 const (
-	CMP_EQUAL CompareResult = iota
-	CMP_GREATER
-	CMP_LESS
-	CMP_NOT_EQUAL
+	CmpEqual CompareResult = iota
+	CmpGreater
+	CmpLess
+	CmpNotEqual
 )
 
 const (
-	MODE_BOTH CacheMode = iota
-	MODE_CACHE
-	MODE_NO_CACHE
+	ModeBoth CacheMode = iota
+	ModeCache
+	ModeNoCache
 )
 
 const (
 	// grpc does not allow to transport a large body more then 4MB in a request
-	DEFAULT_PAGE_COUNT = 4096
+	DefaultPageCount = 4096
 	// the timeout dial to etcd
 	defaultDialTimeout    = 10 * time.Second
 	defaultRequestTimeout = 30 * time.Second
diff --git a/server/plugin/registry/config.go b/server/plugin/registry/config.go
index 1a0d0b0..adce06d 100644
--- a/server/plugin/registry/config.go
+++ b/server/plugin/registry/config.go
@@ -91,7 +91,7 @@ func Configuration() *Config {
 
 		registryAddresses := strings.Join(defaultRegistryConfig.RegistryAddresses(), ",")
 		defaultRegistryConfig.SslEnabled = core.ServerInfo.Config.SslEnabled &&
-			strings.Index(strings.ToLower(registryAddresses), "https://") >= 0
+			strings.Contains(strings.ToLower(registryAddresses), "https://")
 
 		defaultRegistryConfig.DialTimeout, err = time.ParseDuration(beego.AppConfig.DefaultString("connect_timeout", "10s"))
 		if err != nil {
diff --git a/server/plugin/registry/embededetcd/embededetcd.go b/server/plugin/registry/embededetcd/embededetcd.go
index e103225..140a530 100644
--- a/server/plugin/registry/embededetcd/embededetcd.go
+++ b/server/plugin/registry/embededetcd/embededetcd.go
@@ -14,11 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package embededetcd
 
 import (
 	"context"
-	"crypto/tls"
 	"errors"
 	"fmt"
 	errorsEx "github.com/apache/servicecomb-service-center/pkg/errors"
@@ -39,10 +39,8 @@ import (
 	"time"
 )
 
-var embedTLSConfig *tls.Config
-
 func init() {
-	mgr.RegisterPlugin(mgr.Plugin{mgr.REGISTRY, "embeded_etcd", getEmbedInstance})
+	mgr.RegisterPlugin(mgr.Plugin{PName: mgr.REGISTRY, Name: "embeded_etcd", New: getEmbedInstance})
 }
 
 type EtcdEmbed struct {
@@ -76,7 +74,7 @@ func (s *EtcdEmbed) getPrefixEndKey(prefix []byte) []byte {
 		endBytes[l] = 1
 		return endBytes
 	}
-	endBytes[l-1] += 1
+	endBytes[l-1]++
 	return endBytes[:l]
 }
 
@@ -87,9 +85,9 @@ func (s *EtcdEmbed) toGetRequest(op registry.PluginOp) *etcdserverpb.RangeReques
 	}
 	order := etcdserverpb.RangeRequest_NONE
 	switch op.SortOrder {
-	case registry.SORT_ASCEND:
+	case registry.SortAscend:
 		order = etcdserverpb.RangeRequest_ASCEND
-	case registry.SORT_DESCEND:
+	case registry.SortDescend:
 		order = etcdserverpb.RangeRequest_DESCEND
 	}
 	return &etcdserverpb.RangeRequest{
@@ -163,7 +161,7 @@ func (s *EtcdEmbed) toCompares(cmps []registry.CompareOp) []*etcdserverpb.Compar
 			Key: cmp.Key,
 		}
 		switch cmp.Type {
-		case registry.CMP_VERSION:
+		case registry.CmpVersion:
 			var version int64
 			if cmp.Value != nil {
 				if v, ok := cmp.Value.(int64); ok {
@@ -174,7 +172,7 @@ func (s *EtcdEmbed) toCompares(cmps []registry.CompareOp) []*etcdserverpb.Compar
 			compare.TargetUnion = &etcdserverpb.Compare_Version{
 				Version: version,
 			}
-		case registry.CMP_CREATE:
+		case registry.CmpCreate:
 			var revision int64
 			if cmp.Value != nil {
 				if v, ok := cmp.Value.(int64); ok {
@@ -185,7 +183,7 @@ func (s *EtcdEmbed) toCompares(cmps []registry.CompareOp) []*etcdserverpb.Compar
 			compare.TargetUnion = &etcdserverpb.Compare_CreateRevision{
 				CreateRevision: revision,
 			}
-		case registry.CMP_MOD:
+		case registry.CmpMod:
 			var revision int64
 			if cmp.Value != nil {
 				if v, ok := cmp.Value.(int64); ok {
@@ -196,7 +194,7 @@ func (s *EtcdEmbed) toCompares(cmps []registry.CompareOp) []*etcdserverpb.Compar
 			compare.TargetUnion = &etcdserverpb.Compare_ModRevision{
 				ModRevision: revision,
 			}
-		case registry.CMP_VALUE:
+		case registry.CmpValue:
 			var value []byte
 			if cmp.Value != nil {
 				if v, ok := cmp.Value.([]byte); ok {
@@ -209,13 +207,13 @@ func (s *EtcdEmbed) toCompares(cmps []registry.CompareOp) []*etcdserverpb.Compar
 			}
 		}
 		switch cmp.Result {
-		case registry.CMP_EQUAL:
+		case registry.CmpEqual:
 			compare.Result = etcdserverpb.Compare_EQUAL
-		case registry.CMP_GREATER:
+		case registry.CmpGreater:
 			compare.Result = etcdserverpb.Compare_GREATER
-		case registry.CMP_LESS:
+		case registry.CmpLess:
 			compare.Result = etcdserverpb.Compare_LESS
-		case registry.CMP_NOT_EQUAL:
+		case registry.CmpNotEqual:
 			compare.Result = etcdserverpb.Compare_NOT_EQUAL
 		}
 		etcdCmps = append(etcdCmps, compare)
@@ -256,7 +254,7 @@ func (s *EtcdEmbed) getLeaderCurrentRevision(ctx context.Context) int64 {
 func (s *EtcdEmbed) PutNoOverride(ctx context.Context, opts ...registry.PluginOpOption) (bool, error) {
 	op := registry.OpPut(opts...)
 	resp, err := s.TxnWithCmp(ctx, []registry.PluginOp{op}, []registry.CompareOp{
-		registry.OpCmp(registry.CmpCreateRev(op.Key), registry.CMP_EQUAL, 0),
+		registry.OpCmp(registry.CmpCreateRev(op.Key), registry.CmpEqual, 0),
 	}, nil)
 	log.Debugf("response %s %v %v", op.Key, resp.Succeeded, resp.Revision)
 	if err != nil {
@@ -422,8 +420,11 @@ func (s *EtcdEmbed) Watch(ctx context.Context, opts ...registry.PluginOpOption)
 			keyBytes = s.getPrefixEndKey(util.StringToBytesWithNoCopy(key))
 		}
 		watchID := ws.Watch(op.Key, keyBytes, op.Revision)
-		defer ws.Cancel(watchID)
-
+		defer func() {
+			if err := ws.Cancel(watchID); err != nil {
+				log.Error("", err)
+			}
+		}()
 		responses := ws.Chan()
 		for {
 			select {
@@ -545,13 +546,7 @@ func getEmbedInstance() mgr.Instance {
 	}
 
 	if registry.Configuration().SslEnabled {
-		var err error
-		embedTLSConfig, err = mgr.Plugins().TLS().ServerConfig()
-		if err != nil {
-			log.Error("get service center tls config failed", err)
-			inst.err <- err
-			return inst
-		}
+		log.Info("config no use for embedded etcd")
 	}
 
 	serverCfg := embed.NewConfig()
diff --git a/server/plugin/registry/etcd/common.go b/server/plugin/registry/etcd/common.go
index b296c1f..12e6b59 100644
--- a/server/plugin/registry/etcd/common.go
+++ b/server/plugin/registry/etcd/common.go
@@ -23,8 +23,7 @@ import (
 const (
 	// here will new an etcd connection after about 30s(=5s * 3 + (backoff:8s))
 	// when the connected etcd member was hung but tcp is still alive
-	healthCheckTimeout    = 5 * time.Second
-	healthCheckRetryTimes = 3
+	healthCheckTimeout = 5 * time.Second
 
 	// see google.golang.org/grpc/keepalive/keepalive.go
 	// after a duration of this time if the client doesn't see any activity
diff --git a/server/plugin/registry/etcd/etcd.go b/server/plugin/registry/etcd/etcd.go
index 6135379..6251e35 100644
--- a/server/plugin/registry/etcd/etcd.go
+++ b/server/plugin/registry/etcd/etcd.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package etcd
 
 import (
@@ -45,10 +46,10 @@ var firstEndpoint string
 
 func init() {
 	clientv3.SetLogger(&clientLogger{})
-	mgr.RegisterPlugin(mgr.Plugin{mgr.REGISTRY, "etcd", NewRegistry})
+	mgr.RegisterPlugin(mgr.Plugin{PName: mgr.REGISTRY, Name: "etcd", New: NewRegistry})
 }
 
-type EtcdClient struct {
+type Client struct {
 	Client *clientv3.Client
 
 	Endpoints        []string
@@ -61,7 +62,7 @@ type EtcdClient struct {
 	goroutine *gopool.Pool
 }
 
-func (c *EtcdClient) Initialize() (err error) {
+func (c *Client) Initialize() (err error) {
 	c.err = make(chan error, 1)
 	c.ready = make(chan struct{})
 	c.goroutine = gopool.New(context.Background())
@@ -101,7 +102,7 @@ func (c *EtcdClient) Initialize() (err error) {
 	return
 }
 
-func (c *EtcdClient) newClient() (*clientv3.Client, error) {
+func (c *Client) newClient() (*clientv3.Client, error) {
 	client, err := clientv3.New(clientv3.Config{
 		Endpoints:            c.Endpoints,
 		DialTimeout:          c.DialTimeout,
@@ -113,7 +114,10 @@ func (c *EtcdClient) newClient() (*clientv3.Client, error) {
 	})
 	defer func() {
 		if err != nil {
-			alarm.Raise(alarm.IdBackendConnectionRefuse, alarm.AdditionalContext("%v", err))
+			err = alarm.Raise(alarm.IDBackendConnectionRefuse, alarm.AdditionalContext("%v", err))
+			if err != nil {
+				log.Error("", err)
+			}
 
 			if client != nil {
 				client.Close()
@@ -125,7 +129,8 @@ func (c *EtcdClient) newClient() (*clientv3.Client, error) {
 		return nil, err
 	}
 
-	ctx, _ := context.WithTimeout(client.Ctx(), healthCheckTimeout)
+	ctx, cancel := context.WithTimeout(client.Ctx(), healthCheckTimeout)
+	defer cancel()
 	resp, err := client.MemberList(ctx)
 	if err != nil {
 		return nil, err
@@ -161,15 +166,15 @@ epLoop:
 	return client, nil
 }
 
-func (c *EtcdClient) Err() <-chan error {
+func (c *Client) Err() <-chan error {
 	return c.err
 }
 
-func (c *EtcdClient) Ready() <-chan struct{} {
+func (c *Client) Ready() <-chan struct{} {
 	return c.ready
 }
 
-func (c *EtcdClient) Close() {
+func (c *Client) Close() {
 	c.goroutine.Close(true)
 
 	if c.Client != nil {
@@ -178,7 +183,7 @@ func (c *EtcdClient) Close() {
 	log.Debugf("etcd client stopped")
 }
 
-func (c *EtcdClient) Compact(ctx context.Context, reserve int64) error {
+func (c *Client) Compact(ctx context.Context, reserve int64) error {
 	eps := c.Client.Endpoints()
 	curRev := c.getLeaderCurrentRevision(ctx)
 
@@ -196,7 +201,7 @@ func (c *EtcdClient) Compact(ctx context.Context, reserve int64) error {
 			eps, revToCompact, curRev, reserve)
 		return err
 	}
-	log.LogInfoOrWarnf(t, "compacted %s, revision is %d(current: %d, reserve %d)", eps, revToCompact, curRev, reserve)
+	log.InfoOrWarnf(t, "compacted %s, revision is %d(current: %d, reserve %d)", eps, revToCompact, curRev, reserve)
 
 	// TODO can not defrag! because backend will always be unavailable when space in used is too large.
 	/*for _, ep := range eps {
@@ -206,13 +211,13 @@ func (c *EtcdClient) Compact(ctx context.Context, reserve int64) error {
 			log.Errorf(err, "Defrag %s failed", ep)
 			continue
 		}
-		log.LogInfoOrWarnf(t, "Defraged %s", ep)
+		log.InfoOrWarnf(t, "Defraged %s", ep)
 	}*/
 
 	return nil
 }
 
-func (c *EtcdClient) getLeaderCurrentRevision(ctx context.Context) int64 {
+func (c *Client) getLeaderCurrentRevision(ctx context.Context) int64 {
 	eps := c.Client.Endpoints()
 	curRev := int64(0)
 	for _, ep := range eps {
@@ -237,7 +242,7 @@ func max(n1, n2 int64) int64 {
 	return n2
 }
 
-func (c *EtcdClient) toGetRequest(op registry.PluginOp) []clientv3.OpOption {
+func (c *Client) toGetRequest(op registry.PluginOp) []clientv3.OpOption {
 	var opts []clientv3.OpOption
 	if op.Prefix {
 		opts = append(opts, clientv3.WithPrefix())
@@ -257,15 +262,15 @@ func (c *EtcdClient) toGetRequest(op registry.PluginOp) []clientv3.OpOption {
 		opts = append(opts, clientv3.WithRev(op.Revision))
 	}
 	switch op.SortOrder {
-	case registry.SORT_ASCEND:
+	case registry.SortAscend:
 		opts = append(opts, clientv3.WithSort(clientv3.SortByKey, clientv3.SortAscend))
-	case registry.SORT_DESCEND:
+	case registry.SortDescend:
 		opts = append(opts, clientv3.WithSort(clientv3.SortByKey, clientv3.SortDescend))
 	}
 	return opts
 }
 
-func (c *EtcdClient) toPutRequest(op registry.PluginOp) []clientv3.OpOption {
+func (c *Client) toPutRequest(op registry.PluginOp) []clientv3.OpOption {
 	var opts []clientv3.OpOption
 	if op.PrevKV {
 		opts = append(opts, clientv3.WithPrevKV())
@@ -279,7 +284,7 @@ func (c *EtcdClient) toPutRequest(op registry.PluginOp) []clientv3.OpOption {
 	return opts
 }
 
-func (c *EtcdClient) toDeleteRequest(op registry.PluginOp) []clientv3.OpOption {
+func (c *Client) toDeleteRequest(op registry.PluginOp) []clientv3.OpOption {
 	var opts []clientv3.OpOption
 	if op.Prefix {
 		opts = append(opts, clientv3.WithPrefix())
@@ -292,7 +297,7 @@ func (c *EtcdClient) toDeleteRequest(op registry.PluginOp) []clientv3.OpOption {
 	return opts
 }
 
-func (c *EtcdClient) toTxnRequest(opts []registry.PluginOp) []clientv3.Op {
+func (c *Client) toTxnRequest(opts []registry.PluginOp) []clientv3.Op {
 	var etcdOps []clientv3.Op
 	for _, op := range opts {
 		switch op.Action {
@@ -311,30 +316,30 @@ func (c *EtcdClient) toTxnRequest(opts []registry.PluginOp) []clientv3.Op {
 	return etcdOps
 }
 
-func (c *EtcdClient) toCompares(cmps []registry.CompareOp) []clientv3.Cmp {
+func (c *Client) toCompares(cmps []registry.CompareOp) []clientv3.Cmp {
 	var etcdCmps []clientv3.Cmp
 	for _, cmp := range cmps {
 		var cmpType clientv3.Cmp
 		var cmpResult string
 		key := util.BytesToStringWithNoCopy(cmp.Key)
 		switch cmp.Type {
-		case registry.CMP_VERSION:
+		case registry.CmpVersion:
 			cmpType = clientv3.Version(key)
-		case registry.CMP_CREATE:
+		case registry.CmpCreate:
 			cmpType = clientv3.CreateRevision(key)
-		case registry.CMP_MOD:
+		case registry.CmpMod:
 			cmpType = clientv3.ModRevision(key)
-		case registry.CMP_VALUE:
+		case registry.CmpValue:
 			cmpType = clientv3.Value(key)
 		}
 		switch cmp.Result {
-		case registry.CMP_EQUAL:
+		case registry.CmpEqual:
 			cmpResult = "="
-		case registry.CMP_GREATER:
+		case registry.CmpGreater:
 			cmpResult = ">"
-		case registry.CMP_LESS:
+		case registry.CmpLess:
 			cmpResult = "<"
-		case registry.CMP_NOT_EQUAL:
+		case registry.CmpNotEqual:
 			cmpResult = "!="
 		}
 		etcdCmps = append(etcdCmps, clientv3.Compare(cmpType, cmpResult, cmp.Value))
@@ -342,10 +347,10 @@ func (c *EtcdClient) toCompares(cmps []registry.CompareOp) []clientv3.Cmp {
 	return etcdCmps
 }
 
-func (c *EtcdClient) PutNoOverride(ctx context.Context, opts ...registry.PluginOpOption) (bool, error) {
+func (c *Client) PutNoOverride(ctx context.Context, opts ...registry.PluginOpOption) (bool, error) {
 	op := registry.OpPut(opts...)
 	resp, err := c.TxnWithCmp(ctx, []registry.PluginOp{op}, []registry.CompareOp{
-		registry.OpCmp(registry.CmpCreateRev(op.Key), registry.CMP_EQUAL, 0),
+		registry.OpCmp(registry.CmpCreateRev(op.Key), registry.CmpEqual, 0),
 	}, nil)
 	if err != nil {
 		log.Errorf(err, "PutNoOverride %s failed", op.Key)
@@ -354,7 +359,7 @@ func (c *EtcdClient) PutNoOverride(ctx context.Context, opts ...registry.PluginO
 	return resp.Succeeded, nil
 }
 
-func (c *EtcdClient) paging(ctx context.Context, op registry.PluginOp) (*clientv3.GetResponse, error) {
+func (c *Client) paging(ctx context.Context, op registry.PluginOp) (*clientv3.GetResponse, error) {
 	var etcdResp *clientv3.GetResponse
 	key := util.BytesToStringWithNoCopy(op.Key)
 
@@ -373,7 +378,7 @@ func (c *EtcdClient) paging(ctx context.Context, op registry.PluginOp) (*clientv
 
 	tempOp.CountOnly = false
 	tempOp.Prefix = false
-	tempOp.SortOrder = registry.SORT_ASCEND
+	tempOp.SortOrder = registry.SortAscend
 	tempOp.EndKey = op.EndKey
 	if len(op.EndKey) == 0 {
 		tempOp.EndKey = util.StringToBytesWithNoCopy(clientv3.GetPrefixRangeEnd(key))
@@ -412,7 +417,7 @@ func (c *EtcdClient) paging(ctx context.Context, op registry.PluginOp) (*clientv
 			limit = remainCount
 		}
 		if i != 0 {
-			limit += 1
+			limit++
 			start = 1
 		}
 		ops := append(baseOps, clientv3.WithLimit(int64(limit)))
@@ -435,12 +440,12 @@ func (c *EtcdClient) paging(ctx context.Context, op registry.PluginOp) (*clientv
 	}
 
 	if op.Offset == -1 {
-		log.LogInfoOrWarnf(start, "get too many KeyValues(%s) from etcd, now paging.(%d vs %d)",
+		log.InfoOrWarnf(start, "get too many KeyValues(%s) from etcd, now paging.(%d vs %d)",
 			key, recordCount, op.Limit)
 	}
 
 	// too slow
-	if op.SortOrder == registry.SORT_DESCEND {
+	if op.SortOrder == registry.SortDescend {
 		t := time.Now()
 		for i, l := 0, len(etcdResp.Kvs); i < l; i++ {
 			last := l - i - 1
@@ -449,12 +454,12 @@ func (c *EtcdClient) paging(ctx context.Context, op registry.PluginOp) (*clientv
 			}
 			etcdResp.Kvs[i], etcdResp.Kvs[last] = etcdResp.Kvs[last], etcdResp.Kvs[i]
 		}
-		log.LogNilOrWarnf(t, "sorted descend %d KeyValues(%s)", recordCount, key)
+		log.NilOrWarnf(t, "sorted descend %d KeyValues(%s)", recordCount, key)
 	}
 	return etcdResp, nil
 }
 
-func (c *EtcdClient) Do(ctx context.Context, opts ...registry.PluginOpOption) (*registry.PluginResponse, error) {
+func (c *Client) Do(ctx context.Context, opts ...registry.PluginOpOption) (*registry.PluginResponse, error) {
 	var (
 		err  error
 		resp *registry.PluginResponse
@@ -524,11 +529,11 @@ func (c *EtcdClient) Do(ctx context.Context, opts ...registry.PluginOpOption) (*
 
 	resp.Succeeded = true
 
-	log.LogNilOrWarnf(start, "registry client do %s", op)
+	log.NilOrWarnf(start, "registry client do %s", op)
 	return resp, nil
 }
 
-func (c *EtcdClient) Txn(ctx context.Context, opts []registry.PluginOp) (*registry.PluginResponse, error) {
+func (c *Client) Txn(ctx context.Context, opts []registry.PluginOp) (*registry.PluginResponse, error) {
 	resp, err := c.TxnWithCmp(ctx, opts, nil, nil)
 	if err != nil {
 		return nil, err
@@ -539,7 +544,7 @@ func (c *EtcdClient) Txn(ctx context.Context, opts []registry.PluginOp) (*regist
 	}, nil
 }
 
-func (c *EtcdClient) TxnWithCmp(ctx context.Context, success []registry.PluginOp, cmps []registry.CompareOp, fail []registry.PluginOp) (*registry.PluginResponse, error) {
+func (c *Client) TxnWithCmp(ctx context.Context, success []registry.PluginOp, cmps []registry.CompareOp, fail []registry.PluginOp) (*registry.PluginResponse, error) {
 	var err error
 
 	start := time.Now()
@@ -580,7 +585,7 @@ func (c *EtcdClient) TxnWithCmp(ctx context.Context, success []registry.PluginOp
 		}
 		return nil, err
 	}
-	log.LogNilOrWarnf(start, "registry client txn {if(%v): %s, then: %d, else: %d}, rev: %d",
+	log.NilOrWarnf(start, "registry client txn {if(%v): %s, then: %d, else: %d}, rev: %d",
 		resp.Succeeded, cmps, len(success), len(fail), resp.Header.Revision)
 
 	var rangeResponse etcdserverpb.RangeResponse
@@ -600,7 +605,7 @@ func (c *EtcdClient) TxnWithCmp(ctx context.Context, success []registry.PluginOp
 	}, nil
 }
 
-func (c *EtcdClient) LeaseGrant(ctx context.Context, TTL int64) (int64, error) {
+func (c *Client) LeaseGrant(ctx context.Context, TTL int64) (int64, error) {
 	var err error
 
 	start := time.Now()
@@ -616,11 +621,11 @@ func (c *EtcdClient) LeaseGrant(ctx context.Context, TTL int64) (int64, error) {
 	if err != nil {
 		return 0, err
 	}
-	log.LogNilOrWarnf(start, "registry client grant lease %ds", TTL)
+	log.NilOrWarnf(start, "registry client grant lease %ds", TTL)
 	return int64(etcdResp.ID), nil
 }
 
-func (c *EtcdClient) LeaseRenew(ctx context.Context, leaseID int64) (int64, error) {
+func (c *Client) LeaseRenew(ctx context.Context, leaseID int64) (int64, error) {
 	var err error
 
 	start := time.Now()
@@ -640,11 +645,11 @@ func (c *EtcdClient) LeaseRenew(ctx context.Context, leaseID int64) (int64, erro
 		}
 		return 0, errorsEx.RaiseError(err)
 	}
-	log.LogNilOrWarnf(start, "registry client renew lease %d", leaseID)
+	log.NilOrWarnf(start, "registry client renew lease %d", leaseID)
 	return etcdResp.TTL, nil
 }
 
-func (c *EtcdClient) LeaseRevoke(ctx context.Context, leaseID int64) error {
+func (c *Client) LeaseRevoke(ctx context.Context, leaseID int64) error {
 	var err error
 
 	start := time.Now()
@@ -664,11 +669,11 @@ func (c *EtcdClient) LeaseRevoke(ctx context.Context, leaseID int64) error {
 		}
 		return errorsEx.RaiseError(err)
 	}
-	log.LogNilOrWarnf(start, "registry client revoke lease %d", leaseID)
+	log.NilOrWarnf(start, "registry client revoke lease %d", leaseID)
 	return nil
 }
 
-func (c *EtcdClient) Watch(ctx context.Context, opts ...registry.PluginOpOption) (err error) {
+func (c *Client) Watch(ctx context.Context, opts ...registry.PluginOpOption) (err error) {
 	op := registry.OpGet(opts...)
 
 	n := len(op.Key)
@@ -711,13 +716,13 @@ func (c *EtcdClient) Watch(ctx context.Context, opts ...registry.PluginOpOption)
 	return fmt.Errorf("no key has been watched")
 }
 
-func (c *EtcdClient) HealthCheck() {
+func (c *Client) HealthCheck() {
 	if c.AutoSyncInterval >= time.Second {
 		c.goroutine.Do(c.healthCheckLoop)
 	}
 }
 
-func (c *EtcdClient) healthCheckLoop(pctx context.Context) {
+func (c *Client) healthCheckLoop(pctx context.Context) {
 	retries, start := 0, time.Now()
 	d := c.AutoSyncInterval
 	for {
@@ -726,7 +731,8 @@ func (c *EtcdClient) healthCheckLoop(pctx context.Context) {
 			return
 		case <-time.After(d):
 			var err error
-			ctx, _ := context.WithTimeout(c.Client.Ctx(), healthCheckTimeout)
+			ctx, cancel := context.WithTimeout(c.Client.Ctx(), healthCheckTimeout)
+			defer cancel()
 			if err = c.SyncMembers(ctx); err != nil {
 				d := backoff.GetBackoff().Delay(retries)
 				retries++
@@ -739,20 +745,23 @@ func (c *EtcdClient) healthCheckLoop(pctx context.Context) {
 				}
 			} else {
 				log.Info("sync members ok.")
-				alarm.Clear(alarm.IdBackendConnectionRefuse)
+				if err := alarm.Clear(alarm.IDBackendConnectionRefuse); err != nil {
+					log.Error("", err)
+				}
 				if cerr := c.ReOpen(); cerr != nil {
 					log.Errorf(cerr, "retry to health check etcd %s after %s", c.Endpoints, c.AutoSyncInterval)
 				} else {
-					log.Infof("[%s]re-connected to etcd %s", time.Now().Sub(start), c.Endpoints)
+					log.Infof("[%s]re-connected to etcd %s", time.Since(start), c.Endpoints)
 					continue
 				}
 				return
 			}
+
 		}
 	}
 }
 
-func (c *EtcdClient) ReOpen() error {
+func (c *Client) ReOpen() error {
 	client, cerr := c.newClient()
 	if cerr != nil {
 		log.Errorf(cerr, "create a new connection to etcd %v failed",
@@ -767,7 +776,7 @@ func (c *EtcdClient) ReOpen() error {
 	return nil
 }
 
-func (c *EtcdClient) parseEndpoints() {
+func (c *Client) parseEndpoints() {
 	// use the default cluster endpoints
 	addrs := registry.Configuration().RegistryAddresses()
 
@@ -784,7 +793,7 @@ func (c *EtcdClient) parseEndpoints() {
 	c.Endpoints = endpoints
 }
 
-func (c *EtcdClient) SyncMembers(ctx context.Context) error {
+func (c *Client) SyncMembers(ctx context.Context) error {
 	var err error
 
 	start := time.Now()
@@ -856,7 +865,7 @@ func callback(action registry.ActionType, rev int64, kvs []*mvccpb.KeyValue, cb
 func NewRegistry() mgr.Instance {
 	log.Warnf("enable etcd registry mode")
 
-	inst := &EtcdClient{}
+	inst := &Client{}
 	if err := inst.Initialize(); err != nil {
 		inst.err <- err
 		return inst
diff --git a/server/plugin/registry/etcd/etcd_test.go b/server/plugin/registry/etcd/etcd_test.go
index 2067a1e..6e6e384 100644
--- a/server/plugin/registry/etcd/etcd_test.go
+++ b/server/plugin/registry/etcd/etcd_test.go
@@ -115,7 +115,7 @@ func TestEtcdClient(t *testing.T) {
 	registry.Configuration().ClusterAddresses = endpoint
 	registry.Configuration().InitClusterInfo()
 
-	etcdc := &EtcdClient{
+	etcdc := &Client{
 		Endpoints:   []string{endpoint},
 		DialTimeout: dialTimeout,
 	}
@@ -146,7 +146,7 @@ func TestEtcdClient(t *testing.T) {
 		t.Fatalf("TestEtcdClient failed, %#v", err)
 	}
 	select {
-	case <-inst.(*EtcdClient).Err():
+	case <-inst.(*Client).Err():
 	default:
 		t.Fatalf("TestEtcdClient failed, %#v", err)
 	}
@@ -361,7 +361,7 @@ func TestEtcdClient(t *testing.T) {
 
 	// large data
 	var wg sync.WaitGroup
-	for i := 0; i < registry.DEFAULT_PAGE_COUNT+1; i++ {
+	for i := 0; i < registry.DefaultPageCount+1; i++ {
 		wg.Add(1)
 		v := strconv.Itoa(i)
 		go func() {
@@ -377,14 +377,14 @@ func TestEtcdClient(t *testing.T) {
 	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_page/"),
 		registry.WithStrEndKey("/test_page/9999"))
-	if err != nil || !resp.Succeeded || resp.Count != registry.DEFAULT_PAGE_COUNT+1 ||
-		len(resp.Kvs) != registry.DEFAULT_PAGE_COUNT+1 {
+	if err != nil || !resp.Succeeded || resp.Count != registry.DefaultPageCount+1 ||
+		len(resp.Kvs) != registry.DefaultPageCount+1 {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
 	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_page/"), registry.WithPrefix(), registry.WithDescendOrder())
-	if err != nil || !resp.Succeeded || resp.Count != registry.DEFAULT_PAGE_COUNT+1 ||
-		len(resp.Kvs) != registry.DEFAULT_PAGE_COUNT+1 ||
+	if err != nil || !resp.Succeeded || resp.Count != registry.DefaultPageCount+1 ||
+		len(resp.Kvs) != registry.DefaultPageCount+1 ||
 		string(resp.Kvs[0].Key) != "/test_page/999" {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
@@ -403,7 +403,7 @@ func TestEtcdClient(t *testing.T) {
 }
 
 func TestEtcdClient_Compact(t *testing.T) {
-	etcd := &EtcdClient{
+	etcd := &Client{
 		Endpoints:   []string{endpoint},
 		DialTimeout: dialTimeout,
 	}
@@ -424,7 +424,7 @@ func TestEtcdClient_Compact(t *testing.T) {
 }
 
 func TestEtcdClient_Txn(t *testing.T) {
-	etcd := &EtcdClient{
+	etcd := &Client{
 		Endpoints:   []string{endpoint},
 		DialTimeout: dialTimeout,
 	}
@@ -465,7 +465,7 @@ func TestEtcdClient_Txn(t *testing.T) {
 		{Action: registry.Put, Key: []byte("/test_txn/a"), Value: []byte("a")},
 		{Action: registry.Put, Key: []byte("/test_txn/b"), Value: []byte("b")},
 	}, []registry.CompareOp{
-		{[]byte("/test_txn/a"), registry.CMP_VALUE, registry.CMP_EQUAL, "a"},
+		{[]byte("/test_txn/a"), registry.CmpValue, registry.CmpEqual, "a"},
 	}, []registry.PluginOp{
 		{Action: registry.Put, Key: []byte("/test_txn/c"), Value: []byte("c")},
 		{Action: registry.Put, Key: []byte("/test_txn/d"), Value: []byte("d")},
@@ -476,7 +476,7 @@ func TestEtcdClient_Txn(t *testing.T) {
 
 	// case: range request
 	resp, err = etcd.TxnWithCmp(context.Background(), nil, []registry.CompareOp{
-		{[]byte("/test_txn/c"), registry.CMP_VALUE, registry.CMP_EQUAL, "c"},
+		{[]byte("/test_txn/c"), registry.CmpValue, registry.CmpEqual, "c"},
 	}, []registry.PluginOp{
 		{Action: registry.Get, Key: []byte("/test_txn/a")},
 		{Action: registry.Get, Key: []byte("/test_txn/"), Prefix: true},
@@ -490,7 +490,7 @@ func TestEtcdClient_Txn(t *testing.T) {
 		{Action: registry.Put, Key: []byte("/test_txn/a"), Value: []byte("a")},
 		{Action: registry.Put, Key: []byte("/test_txn/b"), Value: []byte("b")},
 	}, []registry.CompareOp{
-		{[]byte("/test_txn/c"), registry.CMP_VALUE, registry.CMP_EQUAL, "c"},
+		{[]byte("/test_txn/c"), registry.CmpValue, registry.CmpEqual, "c"},
 	}, []registry.PluginOp{
 		{Action: registry.Delete, Key: []byte("/test_txn/"), Prefix: true},
 	})
@@ -506,7 +506,7 @@ func TestEtcdClient_Txn(t *testing.T) {
 }
 
 func TestEtcdClient_LeaseRenew(t *testing.T) {
-	etcd := &EtcdClient{
+	etcd := &Client{
 		Endpoints:   []string{endpoint},
 		DialTimeout: dialTimeout,
 	}
@@ -543,7 +543,7 @@ func TestEtcdClient_LeaseRenew(t *testing.T) {
 }
 
 func TestEtcdClient_HealthCheck(t *testing.T) {
-	etcdc := &EtcdClient{
+	etcdc := &Client{
 		Endpoints:        []string{endpoint},
 		DialTimeout:      dialTimeout,
 		AutoSyncInterval: time.Millisecond,
@@ -587,7 +587,7 @@ func TestEtcdClient_HealthCheck(t *testing.T) {
 }
 
 func TestEtcdClient_Watch(t *testing.T) {
-	etcd := &EtcdClient{
+	etcd := &Client{
 		Endpoints:   []string{endpoint},
 		DialTimeout: dialTimeout,
 	}
@@ -823,7 +823,7 @@ func TestEtcdClient_paging(t *testing.T) {
 		// meaning data decreases during paging
 		rangeResp2: generateGetResp(0, 0),
 	}
-	c := EtcdClient{
+	c := Client{
 		Client: &clientv3.Client{
 			KV: mockKv,
 		},
@@ -831,7 +831,7 @@ func TestEtcdClient_paging(t *testing.T) {
 
 	op := registry.PluginOp{
 		Offset: -1,
-		Limit:  registry.DEFAULT_PAGE_COUNT,
+		Limit:  registry.DefaultPageCount,
 	}
 	r, err := c.paging(context2.Background(), op)
 	if err != nil {
@@ -843,7 +843,7 @@ func TestEtcdClient_paging(t *testing.T) {
 }
 
 func TestNewRegistry(t *testing.T) {
-	etcd := &EtcdClient{
+	etcd := &Client{
 		Endpoints:        []string{endpoint, "0.0.0.0:2379"},
 		DialTimeout:      dialTimeout,
 		AutoSyncInterval: time.Millisecond,
@@ -873,7 +873,7 @@ func TestWithTLS(t *testing.T) {
 	}()
 	defer svr.Stop()
 
-	etcd := &EtcdClient{
+	etcd := &Client{
 		DialTimeout: dialTimeout,
 		Endpoints:   []string{svr.Listener.Addr().String()},
 	}
diff --git a/server/plugin/registry/etcd/logger.go b/server/plugin/registry/etcd/logger.go
index 59df04a..5f698c9 100644
--- a/server/plugin/registry/etcd/logger.go
+++ b/server/plugin/registry/etcd/logger.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package etcd
 
 import (
diff --git a/server/plugin/registry/etcd/tracing.go b/server/plugin/registry/etcd/tracing.go
index 72c34ab..df65540 100644
--- a/server/plugin/registry/etcd/tracing.go
+++ b/server/plugin/registry/etcd/tracing.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package etcd
 
 import (
diff --git a/server/plugin/registry/metrics.go b/server/plugin/registry/metrics.go
index d0fa6fc..b1943ea 100644
--- a/server/plugin/registry/metrics.go
+++ b/server/plugin/registry/metrics.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package registry
 
 import (
@@ -50,7 +51,7 @@ var (
 			Subsystem:  "db",
 			Name:       "backend_operation_durations_microseconds",
 			Help:       "Latency of backend operation",
-			Objectives: prometheus.DefObjectives,
+			Objectives: metric.Pxx,
 		}, []string{"instance", "operation", "status"})
 )
 
diff --git a/server/plugin/registry/option.go b/server/plugin/registry/option.go
index b6be514..f137a1e 100644
--- a/server/plugin/registry/option.go
+++ b/server/plugin/registry/option.go
@@ -41,10 +41,10 @@ type PluginOp struct {
 }
 
 func (op PluginOp) String() string {
-	return op.FormatUrlParams()
+	return op.FormatURLParams()
 }
 
-func (op PluginOp) FormatUrlParams() string {
+func (op PluginOp) FormatURLParams() string {
 	var buf bytes.Buffer
 	buf.WriteString("action=")
 	buf.WriteString(op.Action.String())
@@ -72,7 +72,7 @@ func (op PluginOp) FormatUrlParams() string {
 	if op.CountOnly {
 		buf.WriteString("&countOnly=true")
 	}
-	if op.SortOrder != SORT_NONE {
+	if op.SortOrder != SortNone {
 		buf.WriteString("&sort=")
 		buf.WriteString(op.SortOrder.String())
 	}
@@ -95,13 +95,13 @@ func (op PluginOp) FormatUrlParams() string {
 }
 
 func (op PluginOp) NoCache() bool {
-	return op.Mode == MODE_NO_CACHE ||
+	return op.Mode == ModeNoCache ||
 		op.Revision > 0 ||
 		(op.Offset >= 0 && op.Limit > 0)
 }
 
 func (op PluginOp) CacheOnly() bool {
-	return op.Mode == MODE_CACHE
+	return op.Mode == ModeCache
 }
 
 type Operation func(...PluginOpOption) (op PluginOp)
@@ -122,13 +122,13 @@ func WithLease(leaseID int64) PluginOpOption { return func(op *PluginOp) { op.Le
 func WithKeyOnly() PluginOpOption            { return func(op *PluginOp) { op.KeyOnly = true } }
 func WithCountOnly() PluginOpOption          { return func(op *PluginOp) { op.CountOnly = true } }
 func WithGlobal() PluginOpOption             { return func(op *PluginOp) { op.Global = true } }
-func WithNoneOrder() PluginOpOption          { return func(op *PluginOp) { op.SortOrder = SORT_NONE } }
-func WithAscendOrder() PluginOpOption        { return func(op *PluginOp) { op.SortOrder = SORT_ASCEND } }
-func WithDescendOrder() PluginOpOption       { return func(op *PluginOp) { op.SortOrder = SORT_DESCEND } }
+func WithNoneOrder() PluginOpOption          { return func(op *PluginOp) { op.SortOrder = SortNone } }
+func WithAscendOrder() PluginOpOption        { return func(op *PluginOp) { op.SortOrder = SortAscend } }
+func WithDescendOrder() PluginOpOption       { return func(op *PluginOp) { op.SortOrder = SortDescend } }
 func WithRev(revision int64) PluginOpOption  { return func(op *PluginOp) { op.Revision = revision } }
 func WithIgnoreLease() PluginOpOption        { return func(op *PluginOp) { op.IgnoreLease = true } }
-func WithCacheOnly() PluginOpOption          { return func(op *PluginOp) { op.Mode = MODE_CACHE } }
-func WithNoCache() PluginOpOption            { return func(op *PluginOp) { op.Mode = MODE_NO_CACHE } }
+func WithCacheOnly() PluginOpOption          { return func(op *PluginOp) { op.Mode = ModeCache } }
+func WithNoCache() PluginOpOption            { return func(op *PluginOp) { op.Mode = ModeNoCache } }
 func WithWatchCallback(f WatchCallback) PluginOpOption {
 	return func(op *PluginOp) { op.WatchCallback = f }
 }
@@ -162,7 +162,7 @@ func OptionsToOp(opts ...PluginOpOption) (op PluginOp) {
 	}
 	if op.Limit == 0 {
 		op.Offset = -1
-		op.Limit = DEFAULT_PAGE_COUNT
+		op.Limit = DefaultPageCount
 	}
 	return
 }
@@ -184,16 +184,16 @@ func (op CompareOp) String() string {
 type CompareOperation func(op *CompareOp)
 
 func CmpVer(key []byte) CompareOperation {
-	return func(op *CompareOp) { op.Key = key; op.Type = CMP_VERSION }
+	return func(op *CompareOp) { op.Key = key; op.Type = CmpVersion }
 }
 func CmpCreateRev(key []byte) CompareOperation {
-	return func(op *CompareOp) { op.Key = key; op.Type = CMP_CREATE }
+	return func(op *CompareOp) { op.Key = key; op.Type = CmpCreate }
 }
 func CmpModRev(key []byte) CompareOperation {
-	return func(op *CompareOp) { op.Key = key; op.Type = CMP_MOD }
+	return func(op *CompareOp) { op.Key = key; op.Type = CmpMod }
 }
 func CmpVal(key []byte) CompareOperation {
-	return func(op *CompareOp) { op.Key = key; op.Type = CMP_VALUE }
+	return func(op *CompareOp) { op.Key = key; op.Type = CmpValue }
 }
 func CmpStrVer(key string) CompareOperation       { return CmpVer([]byte(key)) }
 func CmpStrCreateRev(key string) CompareOperation { return CmpCreateRev([]byte(key)) }
diff --git a/server/plugin/registry/registry.go b/server/plugin/registry/registry.go
index de14ed5..ee600b8 100644
--- a/server/plugin/registry/registry.go
+++ b/server/plugin/registry/registry.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package registry
 
 import (
diff --git a/server/plugin/registry/types.go b/server/plugin/registry/types.go
index ed5c982..98d119e 100644
--- a/server/plugin/registry/types.go
+++ b/server/plugin/registry/types.go
@@ -40,11 +40,11 @@ type CacheMode int
 
 func (cm CacheMode) String() string {
 	switch cm {
-	case MODE_BOTH:
+	case ModeBoth:
 		return "MODE_BOTH"
-	case MODE_CACHE:
+	case ModeCache:
 		return "MODE_CACHE"
-	case MODE_NO_CACHE:
+	case ModeNoCache:
 		return "MODE_NO_CACHE"
 	default:
 		return "MODE" + strconv.Itoa(int(cm))
@@ -55,11 +55,11 @@ type SortOrder int
 
 func (so SortOrder) String() string {
 	switch so {
-	case SORT_NONE:
+	case SortNone:
 		return "SORT_NONE"
-	case SORT_ASCEND:
+	case SortAscend:
 		return "SORT_ASCEND"
-	case SORT_DESCEND:
+	case SortDescend:
 		return "SORT_DESCEND"
 	default:
 		return "SORT" + strconv.Itoa(int(so))
@@ -70,13 +70,13 @@ type CompareType int
 
 func (ct CompareType) String() string {
 	switch ct {
-	case CMP_VERSION:
+	case CmpVersion:
 		return "CMP_VERSION"
-	case CMP_CREATE:
+	case CmpCreate:
 		return "CMP_CREATE"
-	case CMP_MOD:
+	case CmpMod:
 		return "CMP_MOD"
-	case CMP_VALUE:
+	case CmpValue:
 		return "CMP_VALUE"
 	default:
 		return "CMP_TYPE" + strconv.Itoa(int(ct))
@@ -87,13 +87,13 @@ type CompareResult int
 
 func (cr CompareResult) String() string {
 	switch cr {
-	case CMP_EQUAL:
+	case CmpEqual:
 		return "CMP_EQUAL"
-	case CMP_GREATER:
+	case CmpGreater:
 		return "CMP_GREATER"
-	case CMP_LESS:
+	case CmpLess:
 		return "CMP_LESS"
-	case CMP_NOT_EQUAL:
+	case CmpNotEqual:
 		return "CMP_NOT_EQUAL"
 	default:
 		return "CMP_RESULT" + strconv.Itoa(int(cr))
diff --git a/server/plugin/security/buildin/buildin.go b/server/plugin/security/buildin/buildin.go
index 2fa0cc7..b19f77d 100644
--- a/server/plugin/security/buildin/buildin.go
+++ b/server/plugin/security/buildin/buildin.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package plain
 
 import (
@@ -21,7 +22,7 @@ import (
 )
 
 func init() {
-	mgr.RegisterPlugin(mgr.Plugin{mgr.CIPHER, "buildin", New})
+	mgr.RegisterPlugin(mgr.Plugin{PName: mgr.CIPHER, Name: "buildin", New: New})
 }
 
 func New() mgr.Instance {
diff --git a/server/plugin/tls/buildin/buildin.go b/server/plugin/tls/buildin/buildin.go
index 82d69d4..2adb8d1 100644
--- a/server/plugin/tls/buildin/buildin.go
+++ b/server/plugin/tls/buildin/buildin.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package buildin
 
 import (
@@ -22,7 +23,7 @@ import (
 )
 
 func init() {
-	mgr.RegisterPlugin(mgr.Plugin{mgr.TLS, "buildin", New})
+	mgr.RegisterPlugin(mgr.Plugin{PName: mgr.TLS, Name: "buildin", New: New})
 }
 
 func New() mgr.Instance {
diff --git a/server/plugin/tls/buildin/tls.go b/server/plugin/tls/buildin/tls.go
index 82a3c5c..fc969d9 100644
--- a/server/plugin/tls/buildin/tls.go
+++ b/server/plugin/tls/buildin/tls.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package buildin
 
 import (
diff --git a/server/plugin/tls/tls.go b/server/plugin/tls/tls.go
index e27a20d..eb0d2a4 100644
--- a/server/plugin/tls/tls.go
+++ b/server/plugin/tls/tls.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package tls
 
 import "crypto/tls"
diff --git a/server/plugin/tracing/pzipkin/buildin.go b/server/plugin/tracing/pzipkin/buildin.go
index fb76538..1cfbc00 100644
--- a/server/plugin/tracing/pzipkin/buildin.go
+++ b/server/plugin/tracing/pzipkin/buildin.go
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package pzipkin
... 7215 lines suppressed ...