Refactoring of exhaustive test