More refactoring, more cleanup.