couple minor refactorings