Refactored the dialogs issue #14