refactoring
well, quite a lot of changes to this test case