refactored tag class