NameCom: Refine and Minimize code redundancy

Add class authentication method
Add usage function

Signed-off-by: Dong Zhu <bluezhudong@gmail.com>