Extracted MacroUtils and made Mock implementation more readable