More refactoring, minor changes.