Replace some obscure macros with more structured approaches.