Reorganize and rename macros (move out of header)