No changes, just extract this function from ShowModal() before adding an alternative implementation in the upcoming commits.