refactors macro compilation