refactored tagging