split macro expansion and size updating
put macros replacing code into a function