clean and made some tests

Signed-off-by: Qu Xiaofeng <quxiaofeng.at.polyu@gmail.com>