Further comments and more refactoring.