[ymeng] Refactor to extract popup dialog