More correct way to parse and execute macros