refactor tagging