yet another minor refactoring