better way to parse tags