some more minor refactoring