Refactored the tag text object to be testable