Lots of refactoring stuff
removed some redundant tests, and cleaned the remaining tests
Merge branch 'refactoring' into development