Refactored modal events