Add test case and code clean