Converted macro to function.