Tuplet functions refactoring and fixing