some minor refactorings