Refactor tag upserts
Refactor tag upserts