Performace optimization: treat teleport inputs and outputs separately.