indebtedness) incurred on or before December 15, 2017. (II) Binding written contract exception In the case of a taxpayer who enters into a written binding contract before December 15, 2017, to close on the purchase of a principal residence before January 1, 2018, and who purchases such residence before April 1, 2018, the term pre-December 15, 2017, indebtedness shall include indebtedness secured by such residence. (iii) Refinancing indebtedness (I) In general In the case of any indebtedness which is incurred to refinance indebtedness, such refinanced indebtedness shall be treated for purposes of this subparagraph as incurred on the date that the original indebtedness was incurred to the extent the amount of the indebtedness resulting from such refinancing does not exceed the amount of the refinanced indebtedness. (II) Limitation on period of refinancing Subclause (I) shall not apply to any indebtedness after the expiration of the term of the original indebtedness or, if the principal of such original indebtedness is not amortized over its term, the expiration of the term of the 1st refinancing of such indebtedness (or if earlier, the date which is 30 years after the date of such 1st refinancing). . (d) Coordination with treatment of indebtedness incurred on or before October 13, 1987 Section 163(h)(3)(D) is amended— (1) by striking clause (ii) and redesignating clauses (iii) and (iv) as clauses (ii) and (iii), respectively, and (2) in clause (iii) (as so redesignated)— (A) by striking clause (iii) in the matter preceding subclause (I) and inserting clause (ii) , and (B) by striking clause (iii)(I) in subclauses (I) and (II) and inserting clause (ii)(I) . (e) Coordination with exclusion of income from discharge of indebtedness Section 108(h)(2) is amended by striking $1,000,000 ($500,000 and inserting $750,000 ($375,000 . (f) Conforming amendment Section 163(h)(3) is amended by striking subparagraph (F). (g) Effective date The amendments made by this section shall apply to taxable years beginning after December