refactor tuple implementations