Beginning major refactoring.