Refactor SearchPopup