first attempt at refactoring modals