refine the code after merge from hbase-11339-core.