util function to macro