Refactor testsuite