refactor which extracts tree factory for other macros
rename
add line break
refactor to remove unnecessary inheritance