code refactor.
add some comment.

Signed-off-by: Curno <lyf.curno@gmail.com>