popUp refactor