Macro optimization