build_popup is a separate method