modal test refactoring