Turn functions into macros