popup wnd refactor