A better way to check the tags