tuple: improvements, cleanup, faster compilation