Refactorings for modals.