move tag checking to helper method