A whole lot of refactoring.