slight refactoring.