Implements most of the remaining structural changes.