small refactorings here and there