refactored several more macros into files