Make the helper macro more general.