Refactored tagging/untagging