Minor generalized internal refactoring.