some minor refactoring
...more refactoring