More refactoring of tuplet code