small refactoring according to suggestions