Refactor tag checking and implement 'be' tag