NTuple-izing code