Refactor TagGenerator