AMENDED AND RESTATED MASTER TRANSACTION AGREEMENT