clean up & add some test case

clean up & add some test case