Factoring out macro expansion to a separate function.