Moved dialog customization to a separate function.