minor refactoring in preparation for major rearchitecting