refactored to Tag class