minor refactorings.