add test cases, remove unused.