simplify popup implementation