Refactored to TagContext class