Refactored modal system