refactoring popup