yet more refactoring.