reworking stuff for the new popup handling