Refactor to use PopupWindow