Cleaning up duplicated or dead test functions as well a a few unused imports and variables

there are two duplicated test function name and some dead code that needed cleanup such as a few unused variables and imports. All tests verified to pass
I made several small commits so you can cherry pick at will