Macro refactor