Switched from functions to macros