does this really need to be a macro instead of a function?