Remove the custom macro filter code and use expandMacro for everything