Pretty massive refactor of the modals.