Continued large change to make more extensible.