fix performance issue with parentheses