some more small refactoring