Replace the WSAA macros with functions