Refactored modal handling to make it testable.
no message