some small refactoring