Huge testcase update, some refactoring