few minor refactorings