Add some framework code for macro support