Rebuild the way modals are constructed.