Cleanup and renaming.
More cleanup and refactoring.