Cleaned up
Tightened up abstraction of dialogs