more small refactorings