More modularity, make Esc dismiss the dialog