applied minor refactorings