improve enclosed parenthesis parsing