Tuplet function refactoring