replace modals with helper functions