More refactoring/redesign.