improved contextmenu and dialog apis