Lots of refactoring stuff
removed some redundant tests, and cleaned the remaining tests