some small refactorings