refactoring and popup test"