Rewrite using tuples