refactoring modals