refactor tag method