Refine CC client relevant code

Have refined the code according to Russell's comments