add initial macro file
replace commonly used pattern with macros