adding more macros and refinement for code folding