More refactoring and structure.