Refactored modal dialog class