refactor modals