Extract alert rendering into utility module.