More refactoring and batch changes.