Refactored code relying on tuple implementation details.