Factor out common code
Add parentheses to tuples