refactor matag
merge matag