Cleaning up some of the internals.