optimized code for converting tag to usd