Cleaning up test cases and removing unused code