tuple fix refactor