refactor common Tag and Block functions into DmCore