Let's combine this with `validateTags`, it's almost identical code, and doing the same logic.