Refactor and remove old test cases.