Refactored the tagging system.