refactor ma tag