Dialog: complete rewrite