a couple more refactorings