Reduces duplication in alerta code