refactoring a bit the test logic.